I have a problem with set_post_thumbnail_size() function, which seems it doesn’t work. Or at least it doesn’t work correctly.
I have set a thumbnail size 75x75px in WordPress settings under the media section and have also set another thumbnail size in the functions.php using:
set_post_thumbnail_size(80, 80, true);
How are these two settings supposed to work? I believe the one that I set in the function.php (80x80px) should override the other in the media settings. Am I correct?
This is not the case though. Both sizes of the image exist in my uploads folder and what is worst I can’t get the one I set with set_post_thumbnail_size() no matter what.
When I call
the_post_thumbnail($id, 'thumbnail');
I get the one set in the media settings and not the one I set in my theme’s functions.php. How can I get the other?
UPDATE: It seems I messed up ‘thumbnail’ and ‘post-thumbnail’. In media settings I can set the thumbnail size, which is another image size as ‘medium’ and ‘large’. Using set_post_thumbnail_size() I can set the post-thumbnail (aka featured image) size. Sorry for the mess and thanks for the answers.
They work independently of eachother. You need to call the one you created in the functions.php.
So in your functions.php you would have something like:
and then to call your custom thumbnail you would add this where you want it to appear:
As the original question actually referred to thumbnail and not post-thumbnail, you can update the thumbnail size in functions.php using:
This works for medium and large too:
Hopefully that helps!
AFAIK
set_post_thumbnail_size()
will not override media setting.make sure your theme support for post-thumbnails
and define the image as featured image in Edit Post and Edit Page screens
to call the post-thumbnail
OR
REF : http://codex.wordpress.org/Post_Thumbnails