WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using the wordpress function the_post_thumbnail(); but it seems to behave differently in different places. I have the following code on one page:

the_post_thumbnail(array('275', '190'));

Does exactly what it's supposed to, i get a thumbnail exactly 275 x 190 that has been cropped to fit. I then paste this code to a different template and this time the image has been resized to the maximum dimension, either 275 wide if its landscape or 190 if its portrait.

Anyone know whats going on?

share|improve this question

migrated from stackoverflow.com Jul 1 '11 at 22:14

This question came from our site for professional and enthusiast programmers.

Sure - the method of cropping/ resizing the thumbnail is normally determined in the templates functions.php file. Look for something along the lines of:

<?php set_post_thumbnail_size( $width, $height, $crop ); ?> 

The third parameter is the method of cropping, a boolean. Set it to true and it will crop the image exactly, set it to false and it will resize the image close to the dimensions you provide.

share|improve this answer

Your Answer


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