How stop wordpress creating thumbnails?

对着背影说爱祢 提交于 2019-12-11 19:36:48

问题


How can I stop Wordpress from making thumbnails? It uses a lot of my nodes, and memory!

How can I do this?

PS: My Wordpress site creates 3 images per uploaded image. (and I have galleies of 20-30 images per article => sooooooooo much nodes and memory)...


回答1:


It's very simple to do this...

You have no visible option "stop Wordpress making thumbnails".

You must do the following:

  1. Go to Settings -> Media

  2. Uncheck "Crop thumbnail to exact dimensions (normally thumbnails are proportional)" if is checked

  3. Set at Thumbnail size, Medium size and Large size the Width and Height to 0

Now Wordpress won't create you thumbnails.

I hope this will help you!




回答2:


In wordpress when you upload new image that wordpress set it's thumbnail images accoring to set from admin panel or define in theme functions file. Here is simple way for stop generating thumbnails by simple put below code in your theme function file.

function chnage_filter_image_sizes($sizes){
    $sizes = array();
    return $sizes;
}
add_filter('intermediate_image_sizes_advanced', 'chnage_filter_image_sizes');

Here if you want to generate own thumbnails with custome width and height whenever upload any image than just put parametes as below.

function chnage_filter_image_sizes($sizes){
    $sizes = array('thumbnail_name'=>array('width'=>'120','height'=>'120','crop'=>true));
    return $sizes;
}
add_filter('intermediate_image_sizes_advanced', 'chnage_filter_image_sizes')


来源:https://stackoverflow.com/questions/17491868/how-stop-wordpress-creating-thumbnails

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