Here’s a simple way to make sure your thumbnails display exactly how you’d like them to. If you’ve ever asked yourself the following question, you’re about to be super happy. How do I adjust the position WordPress crops my images?
Adjust WordPress Image Crop Position
Say you want your image to be cropped from the top and center? Add the code below to your functions file under the *Register Image Sizes* area, via FTP. You can adjust the height and width of your new image size by modifying the 800 and 400, and name it whatever you like by replacing “yourimagenamehere”.
(please don’t do this if you’re not comfortable modifying theme files, and if you are, you still want to save a backup copy of your functions file locally *just in case* you accidentally add an extra character, or something goes wonky for whatever reason)
//* Register Image Sizes | |
add_image_size( ‘yourimagenamehere’, 800, 400, array( ‘center’, ‘top’ ) ); |
view rawAdd New Featured Image Cropped Top Center hosted with ❤ by GitHub
You can use left, right, top or bottom as well as left, center and right for the positioning.
Once you’ve added this code to your functions file, you’ll want to regenerate your thumbnails using the regenerate thumbnails plugin.
You’ll now have this image size option available to use anywhere you see an image size dropdown. Yay!
Download the How to Start Blogging Guide
Explore this FREE GUIDE to take a deep dive into how to start blogging to make money. Get a PDF version of this guide right to your email, plus weekly tips from our blogging experts at BizBudding.
