wordpress上传图片不自动生成缩略图的解决方法
因为站点不需要显示这么多图片,只需要原图就OK了,所以就要修改下媒体设置。打开设置->媒体,将不需要的缩略图宽度高度都设置为0就可以了。如下图:
但是这样设置之后,还是会生成其它分辨率的缩略图,笔者猜测应该是主题的问题,于是就去主题内查找,笔者用的主题是themolio。后来在主题文件的functions.php中找到了这样的代码:
function themolio_setup() {</p> <p> /* 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');</p> <p> /**
* 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);</p> <p> /**
* 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,150,true);
add_image_size('themolio-four-col-grid-image-sidebar',171,110,true);</p> <p> /**
* 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,300,true);</p> <p> register_nav_menu('primary', __('Primary Menu', 'themolio'));</p> <p> add_theme_support('post-formats', array('link', 'gallery', 'status', 'quote', 'image', 'video'));</p> <p> if(themolio_is_wp_version('3.4')) {
add_theme_support('custom-background');
} else {
add_custom_background();
}
}
其中add_image_size就是增加缩略图设置的方法,根据需要注释掉即可。其它主题也可以依此类推,只要搜索关键词add_image_size,应当就能找到缩略图的设置。
最后生成多张缩略图的问题就搞定了。
友情提示
如果日后有需要缩略图,可以在媒体->媒体库->选择需要的图片点编辑->编辑图片,然后就可以裁剪图片了。最后报下wordpress和使用主题的版本:
wordpress是3.4.1版本
主题是Themolio,版本是1.2
栏 目:WordPress
下一篇:wordpress在IIS下伪静态后子目录无法访问的解决方法
本文标题:wordpress上传图片不自动生成缩略图的解决方法
本文地址:https://www.xiuzhanwang.com/a1/WordPress/12815.html
您可能感兴趣的文章
阅读排行
本栏相关
- 05-31wordpress修改后台登录地址教程
- 05-31WordPress自定义用户头像实现代码
- 01-11WordPress增加文章排序方式
- 01-11修改wordpress上传临时目录解决wordpre
- 01-11wordpress get
- 01-11自己做wordpress评论插件修改评论样式
- 01-11在wordpress文章末尾添加内容的简单方
- 01-11wordpress获取文章评论数过滤掉作者代
- 01-11wordpress dynamic
- 01-11不用wordpress插件显示文章浏览统计功
随机阅读
- 08-05DEDE织梦data目录下的sessions文件夹有什
- 04-02jquery与jsp,用jquery
- 01-11ajax实现页面的局部加载
- 01-10使用C语言求解扑克牌的顺子及n个骰子
- 08-05织梦dedecms什么时候用栏目交叉功能?
- 01-10C#中split用法实例总结
- 01-10delphi制作wav文件的方法
- 08-05dedecms(织梦)副栏目数量限制代码修改
- 01-10SublimeText编译C开发环境设置
- 01-11Mac OSX 打开原生自带读写NTFS功能(图文