0

I don't understand why this happens

I created a new image size in functions.php called blog. Code looks like this

    add_theme_support( 'post-thumbnails' );
add_image_size('blog', 134, 134, false); 

Yet for some reason when the featured image comes out as 134 by 58 when called like this

 <?php the_post_thumbnail('blog'); ?>

Can anyone tell me why that is? The actual image uploaded to the library is much larger than that

1 Answer 1

0

When you set that final argument of add_image_size() to false, it scales the image down until the height or width matches one of the set values, then it maintains the proportions.

For example:

  • A 600px by 400px image using your settings is 134px wide (the long dimension) and then 89px tall (proportional to 134px wide).
  • If the image were 400px by 600px it would be 134px tall by 89px wide.
2
  • Okay, that makes sense but why didn't it change when I changed it to true? The image is big enough
    – Jamie
    Aug 30, 2012 at 4:21
  • If you change add_image_size() parameters after the fact, you often have to use a plugin like Regenerate Thumbnails to recrop all the photos.
    – mrwweb
    Aug 30, 2012 at 14:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.