How to Turn On Cropping for Thumbnails in WordPress

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:


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

FREE EBOOK
Your step-by-step roadmap to a profitable web dev business. From landing more clients to scaling like crazy.

By downloading this ebook I consent to occasionally receive emails from WPMU DEV.
We keep your email 100% private and do not spam.

FREE EBOOK
Plan, build, and launch your next WP site without a hitch. Our checklist makes the process easy and repeatable.

By downloading this ebook I consent to occasionally receive emails from WPMU DEV.
We keep your email 100% private and do not spam.

// 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”);
}

 

Thanks to WP-Snippet for this handy tip!

Have a great weekend!