Wordpress featured image custom crop rejection

387 views Asked by At

I am currently unable to use my newly cropped images in the media library as my featured post images. When I go to selected the featured image I see and click on the cropped image. However, once the image is selected the cropped image seems to be reverted to the full size image with auto crop.

I added a custom thumbnail size in my functions file of 360, 360, true.

Any idea why this may be happening?

Thanks in advance and happy holidays!

2

There are 2 answers

4
Laxmana On

Let's say in your function.php you have add_image_size('my-new-size-name', 360, 360, true);

To get the cropped image you have to use get_the_post_thumbnail(get_the_ID(), 'my-new-size-name') or the_post_thumbnail(get_the_ID(), 'my-new-size-name') if you want to display it.

You can't select the cropped image from the admin panel and use it as a featured image. The way it appears depends on your theme.

So if in your theme there is the_post_thumbnail() it will take the full size no matter what.

If you don't want to put an extra code in your theme then you have to crop yout image yourself and upload it again and set it as featured image.

0
Arshad Hussain On

Use this in while loop or anywhere where you want to show thumbnail:

the_post_thumbnail(array(300,300));