Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

up vote 0 down vote accepted

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.
share|improve this answer
    
Okay, that makes sense but why didn't it change when I changed it to true? The image is big enough –  Jamie Aug 30 '12 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 '12 at 14:05
    
Thanks. I will try that plugin and see what happens –  Jamie Aug 30 '12 at 22:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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