Is there any plugin to set custom image size for different post type’s thumbnail? Or how to set it?

Building

Quick summary

Learn how to adjust image sizes for various post types’ thumbnails in WordPress using the MultiPostThumbnails plugin. Easily set custom sizes and seamlessly incorporate them into your template files for a personalized touch.

Is there any plugin to set custom image size for different Post Type’s Thumbnail? OR How to set it?

USe MultiPostThumbnails WordPress plugins.

// Add Multiple featured box thumbnails In CPT ITem
if (class_exists(‘MultiPostThumbnails’)) {

new MultiPostThumbnails(array(
‘label’ => ‘Logo’,
‘id’ => ‘logo’,
‘post_type’ => ‘ait-dir-item’
) );

}

// generate custom image size for that featured box

add_image_size(‘ait-dir-item-logo-thumbnail’, 400, 160);
add_image_size(‘ait-dir-item-search-logo-thumbnail’, 250, 85);

// use it in your template file

if (class_exists(‘MultiPostThumbnails’)) :
MultiPostThumbnails::the_post_thumbnail(get_post_type(), ‘logo’, NULL, ‘ait-dir-item-logo-thumbnail’);
endif;
Date: May 21, 2014
|

Leave a Reply

Your email address will not be published. Required fields are marked *