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

right now, a thumbnail will be either 150px in height or in width, depending if it's landscape or portrait. Is there a way to make them always the same width and scale them in height accordingly, without squaring them?

Kind regards

share|improve this question
up vote 3 down vote accepted

Use add_image_size() in your functions.php:

add_image_size( 'post-icon', 150);

...and then use this in your template:

<?php the_post_thumbnail('post-icon'); ?>
share|improve this answer

Your Answer


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.