- This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- The forum ‘Other’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Hey guys!
I’m actually having some kind of a small problem I guess. Basically I want to have the possibility to have different thumbnail sizes. Im having 3 types of posts, the blog post, which has a small 274×9999 size. The Work post, which has a bigger 635×9999 size and the background post, which is a post type where I can upload backgrounds which people can download, but for previewing those backgrounds I want of course a thumbnail which will be 249×147 big.
As I was reading the wp-codex I come across a function called add_image_size() – so from the documentary I’ve been reading, I can, with theme support (post-thumbnails), create a bunch of image sizes, so what I did was the following:
add_theme_support('post-thumbnails');
add_image_size( 'background-thumb', 249, 147 );
add_image_size( 'blog-thumb', 274, 9999 );
add_image_size( 'work-thumb', 635, 9999 );
I added this code to my functions.php, added all sort of featured post images and added into my index.php the following (of course into the loop):
Well, it displays the usual 150×150 thumbnail of wordpress. Anyone know how I can make this work?
Regards.
Nevermind, got it working by setting the fourth parameter of the add_image_size to true. By default it seems to be false.