Wordpress different featured image size for different post types Wordpress different featured image size for different post types wordpress wordpress

Wordpress different featured image size for different post types


In your theme functions file, you can define new image sizes that apply to any images uploaded from then forward:

add_image_size('new-thumbnail-size',600,340, true)

Once you've defined a new image size, you can use the_post_thumbnail as usual but include the new image size to display that instead of the thumbnail default:

the_post_thumbnail( 'new-thumbnail-size' )

A little bit more detail: http://gavinsmith.me/2010/10/multiple-post-thumbnail-featured-image-sizes-in-wordpress/


To answer your question, currently (Version 3.4.1) it is not possible. And the reason is simple: If you upload a file to your media library your image is not related to any post nor even a post_type, so wordpress cannot know, that this file has to be resized into a different format.

Realizing your wish (as it is one of mine too) means, that the image has to be created, if an image is added to a post with a custom post type.So until this might be realized (I do not expect that this will come in time) you have to define your custom image size globally dealing the disadvantage, that every file you are uploading will be stored multiple times (one per add_image_size() call), even if you will use only one image in your template.