WordPress.org

Forums

Cannot add/insert image to custom post type. (8 posts)

  1. paperpariah
    Member
    Posted 4 years ago #

    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

  2. Tara
    Volunteer Moderator
    Posted 4 years ago #

    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.

  3. paperpariah
    Member
    Posted 4 years ago #

    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?

  4. Tara
    Volunteer Moderator
    Posted 4 years ago #

    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.

  5. web00132
    Member
    Posted 4 years ago #

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

  6. paperpariah
    Member
    Posted 4 years ago #

    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...

  7. ajuliano
    Member
    Posted 4 years ago #

    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

  8. web00132
    Member
    Posted 4 years ago #

    Yes, he finally fixed it! :)

Topic Closed

This topic has been closed to new replies.

About this Topic