I want all my thumbnails to be the same size (220px by 130px).

I've tried both the code set_post_thumbnail_size( 220, 130); and set_post_thumbnail_size( 220, 130, true); in my functions.php file but the height of the image in my browser is 220px by 92px. Why is this and how can I get the image size I want?

In static sites I normally use object-fit: cover so that things are not stretched. Would be nice if Wordpress could do the same thing.

1 Answer 1


This code will only work with images uploaded after it was implemented, for older images use a plugin like "thumbnail regenerate" to resize them.

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.