How to stop WordPress creating multiple copies of images but keeping the size info?

风格不统一 提交于 2019-12-11 07:48:44

问题


I was wondering if it is possible to stop WordPress from creating multiple copies of imagens, but still keeping, let's say, "medium" size.

I already edited my functions.php and the media options, leaving it all to "0", and it's fine. But, when I add an image do my post, the code reads as follow:

<img src="http://example.com/wp-content/uploads/2019/08/image.jpg" alt="" width="2008" height="1004" class="aligncenter size-full wp-image-XXXX" /></a>

I am using Jetpack and, for design reasons, I need the code to add the size to the image and change the "size-xxxx" class. For example:

<img src="http://example.com/wp-content/uploads/2019/08/image-1280x600.jpg" alt="" width="1280" class="aligncenter size-large wp-image-XXXX" /></a>

I can do this all manually, yes. But is there a way that I don't need to type this things everytime? Thank you!

来源:https://stackoverflow.com/questions/57659056/how-to-stop-wordpress-creating-multiple-copies-of-images-but-keeping-the-size-in

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!