Multiple php the_post_thumbnail sizes
-
Couldn’t find this answer in the forum, so hopefully this is easy enough to do. Basically I would like to have two different sizes available for the ‘featured image’. The only time I will use the other is when my featured image is an infographic, for example. All other times, the default size/crop is just fine.
OK, my theme has the following size in functions for the featured image:
add_image_size( 'single-large', 564, 272, true ); // Single post/page large
and appears in single.php as
<?php the_post_thumbnail('single-large'); ?>
which is fine (and I’d like to keep all other posts just like this except those that need this other size). But I need just one more size available for ones that need to be longer height. Is this possible?
I know I can ‘insert’ an image, but that won’t make it a featured image and it won’t appear as a thumbnail on the homepage or categories.
I’ve added a new image size of:
add_image_size( 'single-large-graphic', 564, 1000, true );
but not sure how to make that an additional option for a featured image should I want it for a specific image/post.
Any ideas? Thank you to the coders out there ?? ??
- The topic ‘Multiple php the_post_thumbnail sizes’ is closed to new replies.