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?


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' ); }

protected by Pieter Goosen Mar 20 '15 at 11:39

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

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.