Sign up ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm looking for a way to only set the width of a thumbnail size and let the height set auto. So if I have two images. One is 600px/420px and one is 600px/600px. I want to set only the width of the thumbnail to 200px so wordpress crops the thumbnails of the above dimensions to 200px/140px and 200px/200px. Any ideas?

share|improve this question

1 Answer 1

up vote 6 down vote accepted

In your theme's functions.php file:

/* register new image size
 * 200px wide and unlimited height
add_image_size( 'wpse73058', 200, 9999, false );

In a template or the like:

if ( has_post_thumbnail() ) { the_post_thumbnail( 'wpse73058' ); }
share|improve this answer

protected by Pieter Goosen Mar 20 at 11:39

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

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