I'm having trouble finding out how to accomplish this - I want to display a cropped version of an image in the post. So when it's uploaded, it would automatically be displayed cropped. Is there any way to do that? For example, this would be the original image uploaded and this is what it would look like in the post

Is there a way to set that cropping be default? It would be great if the user would upload the image already cropped, but if they don't, I want to have a fallback.


try this

  1. define a custom image size (add_image_size)


    where w and h for height and width of your image.and fourth parameter true for hard croping of image.read wordpress codex for that

  2. put your custom image size name in the_post_thumbnail function



if your design is not responsive then you can set image size using css.

--class/id-- img{
  • The site is responsive, but that first solution should work. Thanks!! I somehow overlooked that crop part
    – tstrebeck
    Jun 5 '13 at 12:42

You can use custom image size as in above answer and use it with the the_post_thumbnail function. If you don't want to do this and want to apply the crop to all the featured images then there is a more simple solution than this.

In wordpress admin, goto


There you can set thumbnail size and there is also an option for cropping to exact dimension. Hope this helps.

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

This function allows you to register additional image sizes for Featured Images, set $crop parameter to true

See codex

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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