• Clicking the “Add Images” button when on a custom post type page brings up the “Add an image” overlay as you would expect but as soon as I try to insert an image (either from file or from media library) I get a blank white screen and the image is not inserted.

    I am using the following code register the custom post type and everything else works fine.

    /**
     * Add post types
     */
    
    add_action('init', 'events_register');  
    
    function events_register() {
    	$args = array(
    		'label' => __('photography'),
    		'singular_label' => __('photography'),
    		'public' => true,
    		'show_ui' => true,
    		'capability_type' => 'post',
    		'hierarchical' => false,
    		'rewrite' => true,
    		'menu_position' => 5,
    		'supports' => array('title', 'editor', 'comments', 'revisions')
    	);  
    
    	register_post_type( 'photography' , $args );
    }

    Any help would be great! I have no idea why this problem occurs, I cna insert images into posts and pages fine.

    Thanks in advance

Viewing 7 replies - 1 through 7 (of 7 total)
  • Moderator t-p

    (@t-p)

    it’s likely that a plugin is causing the glitch. Tty:

    -deactivating all plugins. If the problem goes away, activate them individually to find the cause.

    Thread Starter paperpariah

    (@paperpariah)

    The only plugin I use is “custom field template“. Looks like your right when I deactivate it, I can insert images no problem. Doesn’t really solve the problem tho, I really need CFT so can’t keep it deactivated – but I also need images in my custom post types..

    Any idea?

    Moderator t-p

    (@t-p)

    Looks like your right when I deactivate it, I can insert images no problem. … I really need CFT so can’t keep it deactivated – but I also need images in my custom post types..

    its really your choice. I have no other ideas.

    web00132

    (@web00132)

    I have the exact same problem! Paperpariah: have you found a good solution?

    Thread Starter paperpariah

    (@paperpariah)

    thanks for the help t-p

    web00132: Afraid not – I haven’t had a chance to try and fix myself, for now I have to import images into a new post then copy HTML into my custom post type…

    ajuliano

    (@ajuliano)

    I had the same problem with version 1.7.8 of Custom Field Template plugin.

    Updated to version 1.7.9 and now it’s working. View the changelog

    web00132

    (@web00132)

    Yes, he finally fixed it! ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Cannot add/insert image to custom post type.’ is closed to new replies.