加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > CMS系统 > wordpress > 正文

wordpress上传图片不自动生成缩略图的解决方法

发布时间:2020-12-14 14:47:59 所属栏目:wordpress 来源:网络整理
导读:因为站点不需要显示这么多图片,只需要原图就OK了,所以就要修改下媒体设置。打开设置->媒体,将不需要的缩略图宽度高度都设置为0就可以了。如下图: 但是这样设置之后,还是会生成其它分辨率的缩略图,笔者猜测应该是主题的问题,于是就去主题内查找,笔者

因为站点不需要显示这么多图片,只需要原图就OK了,所以就要修改下媒体设置。打开设置->媒体,将不需要的缩略图宽度高度都设置为0就可以了。如下图:

但是这样设置之后,还是会生成其它分辨率的缩略图,笔者猜测应该是主题的问题,于是就去主题内查找,笔者用的主题是themolio。后来在主题文件的functions.php中找到了这样的代码:

/* Make Themolio available for translation. * Translations can be added to the /languages/ directory. * If you're building a theme based on Themolio,use a find and replace * to change 'themolio' to the name of your theme in all the template files. */ load_theme_textdomain('themolio',get_template_directory().'/languages' ); add_editor_style(); add_theme_support('automatic-feed-links'); add_theme_support('post-thumbnails');

/** * This sets up the image size for the grid based top-down layouts (with no sidebar). * If you change the width/height of your content, * you will have to modify the width and height mentioned below as well */ add_image_size('themolio-two-col-grid-image-nosidebar',460,300,true); add_image_size('themolio-three-col-grid-image-nosidebar',290,200,true); add_image_size('themolio-four-col-grid-image-nosidebar',210,150,true);

/** * This sets up the image size for the grid based top-down layouts (with sidebar). * If you change the width/height of your content, * you will have to modify the width and height mentioned below as well */ add_image_size('themolio-two-col-grid-image-sidebar',356,250,true); add_image_size('themolio-three-col-grid-image-sidebar',230,true); add_image_size('themolio-four-col-grid-image-sidebar',171,110,true);

/** * This sets up the image size for the featured image. * If you change the width/height of your content, * you will have to modify the width and height mentioned below as well */ add_image_size('themolio-featured-image',800,true);

register_nav_menu('primary',__('Primary Menu','themolio'));

add_theme_support('post-formats',array('link','gallery','status','quote','image','video'));

if(themolio_is_wp_version('3.4')) { add_theme_support('custom-background'); } else { add_custom_background(); }}

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读