禁用在WordPress中裁剪特色图片

问题描述:

我将特色图片用作发布图片,但是在上传它设置为特色图片时裁剪的图片时,我没有找到任何解决方案,有谁可以帮忙吗?

I am using featured image as a post image but on uploading a image it crops while setting it as featured image, i dnt find any solution for it, Can any one help?

Wordpress管理控制台屏幕截图:-

此图片实际上为 1024x702 ,但尺寸为 940x198 >,我找不到解决此问题的方法...

This image is actually 1024x702 but it cuts to 940x198, i cant find any soltuion for this how to disabling the cropping...

不确定如何禁用裁剪,但是您可以尝试使用 add_image_size 函数注册更大的图像大小。

Not sure how to disable cropping but you could try to use add_image_size function to register a bigger image size.

类似这样的东西:(将其添加到functions.php中)

Something like this: (add this in functions.php)

add_image_size( 'featuredImageCropped', 1024, 768, true );

然后在模板中找到the_post_thumbnail并进行如下修改:

And then locate the_post_thumbnail in the template and modify it like this:

the_post_thumbnail( 'featuredImageCropped' );