• Resolved JTWilcox

    (@jtwilcox)


    Hello,

    I’m trying to get this to work with a custom post type that is using custom fields (via the More Fields plugin). I can’t get the Multiple Post Thumbnails plugin meta box to show up on my custom posts. I’ve only set a couple of things in my supports array when registering the custom post, and I think this is where I’m running into trouble.

    $args = array(
    		'labels' => $labels,
    		'public' => true,
    		'publicly_queryable' => true,
    		'show_ui' => true,
    		'query_var' => true,
    		'rewrite' => true,
    		'capability_type' => 'post',
    		'hierarchical' => false,
    		'menu_position' => null,
    		'supports' => array('thumbnail','custom fields','MultiPostThumbnails')
    	  ); 
    
    	register_post_type( 'videos' , $args );

    As you can see, I tried throwing ‘MultiPostThumbnails’ into my supports. And I’ve tried everything else I can think of to get it to show up with no luck. Is there an obvious answer to this, or am I barking up the wrong tree? Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • I have the same problem… the multiple posts show up in the normal articles but not in my custom fields articles…

    Thread Starter JTWilcox

    (@jtwilcox)

    I did end up getting this to work. Didn’t have to do with setting supports on the custom post type registration. In functions.php, I added this line below the existing thumbnail code:

    //Set second featured image
    	if (class_exists('MultiPostThumbnails')) {
    		new MultiPostThumbnails(array(
    		'label' => 'Secondary Image',
    		'id' => 'secondary-image',
    		'post_type' => 'videos'
    		)
    	);
    	}
    	add_image_size('second-image', 160, 95);

    And then I called the thumbnail in my template using the normal way suggested in the plugin documentation.

    So I made sure the post type was set. And then also make sure when you’re editing a custom post type post that the box for setting the secondary image is visible up in the screen options.

    i did a workaround… i created a custom field with an image and edited the code so that the custom field image appears as a second-image…

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Multiple Post Thumbnails] Custom Post Type Registration & Supports’ is closed to new replies.