I am trying to control my post thumbnail size on two different pages.
I am using
set_post_thumbnail_size( 875, 175 );
To control the size on my index page. And then when they open the post I want the single.php to have the full size image.
Use get_the_post_thumbnail
, you would call this in your single.php template and specify the size you want.
You add an image size with add_image_size();
(documentation) and then call on the thumbnail size in your theme with the_post_thumbnail();
. You can add as many image sizes as you would like.
So lets create two sizes with
add_image_size( 'home-thumb', 330, 175, true);
add_image_size( 'single-thumb', 875, 300, true );
This will add them and you can call them using using the_post_thumbnail('single-thumb');
since you want the single page to have the full image size you can just use the_post_thumbnail();
.
Try this:
if(is_single()) {
set_post_thumbnail_size( 875, 175 );
} else {
set_post_thumbnail_size( other dimensions here );
}