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 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.

1 Answer 1

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

 
discard

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