WordPress/WooCommerce上传媒体可创建19个其他图像尺寸 [英] WordPress / WooCommerce upload media creates 19 additional image sizes

查看:231
本文介绍了WordPress/WooCommerce上传媒体可创建19个其他图像尺寸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将WooCommerce用于客户端网站,但磁盘空间有问题.当为产品上传图像时,系统似乎正在为原始图像创建其他19种图像尺寸. 现在我知道我在媒体设置和WooCommerce设置中设置了Thumnbail,Medium,Large等,但是我不明白为什么还要创建其他19种尺寸? 这是我的wp-uploads/2014/01文件夹中图像的屏幕截图:

I'm using WooCommerce for a client website, and I'm having an issue with disk space. When an image is uploaded for a product, the system seems to be creating 19 other image sizes for the original image. Now I know that I set a Thumnbail, Medium, Large and so on in the Media Settings and in WooCommerce settings, but I don't understand why it's creating 19 other sizes? Here's a screenshot of an image in my wp-uploads/2014/01 folder:

如您所见,一个图像将占用相当多的空间-我必须考虑到每个产品至少具有4个不同的图像!

As you can see, one image will take up a fair amount of space - I've got to consider that each product has at least 4 different images!

如何减少正在创建的图像数量?

How do I reduce the amount of images that are being created?

推荐答案

这是因为某个插件或当前主题正在注册图像大小.每个注册的图像尺寸都会生成该特定尺寸的图像.您需要找出正在执行哪个插件或主题.通常,这应该是您的主题.查看您主题的function.php或插件文件,然后找到函数调用,如下所示:-

This is because a certain plugin or current theme is registering image sizes. Each registered image size generate an image of that particular dimensions. You need to find out which plugin or theme is doing so. Normally, that should be your theme. Look in your theme's function.php or plugin files and find function calls like this:-

add_image_size( 'category-thumb', 300, 9999 );

删除必需的add_image_size函数调用,以避免生成图像的多个副本.

Remove the required add_image_size function calls to avoid generating multiple copies of the image.

http://codex.wordpress.org/Function_Reference/add_image_size

这篇关于WordPress/WooCommerce上传媒体可创建19个其他图像尺寸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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