Plugin Directory

Multiple Post Thumbnails

Adds multiple post thumbnails to a post type. If you've ever wanted more than one Featured Image on a post, this plugin is for you.

I'm trying to upgrade to a new verions of WordPress and get an error about `MultiPostThumbnails`

This is caused by using the example in previous readmes that didn't do a check for the MultiPostThumbnails class existing first. This has been corrected in the Installation section.

How do I register the same thumbnail for multiple post types?

You can loop through an array of the post types:

if (class_exists('MultiPostThumbnails')) {
    $types = array('post', 'page', 'my_post_type');
    foreach($types as $type) {
        $thumb = new MultiPostThumbnails(array(
            'label' => 'Secondary Image',
            'id' => 'secondary-image',
            'post_type' => $type
            )
        );
    }
}

How do I use a custom thumbnail size in my theme?

After you have registered a new post thumbnail, register a new image size for it. e.g if your post thumbnail id is secondary-image and it is for a post, it probably makes sense to use something like:

add_image_size('post-secondary-image-thumbnail', 250, 150);

This will register a new image size of 250x150 px. Then, when you display the thumbnail in your theme, update the call to MultiPostThumbnails::the_post_thumbnail() to pass in the image size:

MultiPostThumbnails::the_post_thumbnail('post', 'secondary-image', NULL,  'post-secondary-image-thumbnail');

You can register multiple image sizes for a given thumbnail if desired.

Requires: 2.9.2 or higher
Compatible up to: 3.2.1
Last Updated: 2011-11-10
Downloads: 23,285

Average Rating

4 stars
(67 ratings)

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

1 person says it works.
1 person says it's broken.

0,1,0
100,3,3 71,7,5
75,8,6 100,7,7
100,6,6
100,3,3
100,1,1 100,1,1
50,8,4 83,6,5
100,1,1
100,3,3
100,3,3
73,11,8 80,5,4 100,1,1 100,4,4
57,7,4
100,12,12 100,8,8
50,2,1