禁用在WordPress中裁剪特色图片 [英] disable cropping featured image in wordpress

查看:185
本文介绍了禁用在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' ); 

这篇关于禁用在WordPress中裁剪特色图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆