How to Turn On Cropping for Thumbnails in WordPress

Do thumbnail images on your site look all squashed? Maybe all the people in your photos look super skinny or extra wide?

In today’s Weekend WordPress Project, I’ll show you a quick and easy way to crop your thumbnails instead of scaling them.

Thumbnails feature image

To crop thumbnail images for different sizes, just add the following code to your functions.php file:

{code}
// Standard Size Thumbnail
if(false === get_option(“thumbnail_crop”)) {
add_option(“thumbnail_crop”, “1”); }
else {
update_option(“thumbnail_crop”, “1”);
}

// Medium Size Thumbnail
if(false === get_option(“medium_crop”)) {
add_option(“medium_crop”, “1”); }
else {
update_option(“medium_crop”, “1”);
}

// Large Size Thumbnail
if(false === get_option(“large_crop”)) {
add_option(“large_crop”, “1”); }
else {
update_option(“large_crop”, “1”);
}

{/code}

Thanks to WP-Snippet for this handy tip!

Have a great weekend!