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 3.1顶部admin bar不见了的处理办法

(如下图),民间的称号叫admin bar,中文咱们就把它叫做治理工具栏吧,也有称之为治理工具条、快捷链接栏的...

WordPress中用于获取及自定义头像图片的PHP脚本详解

get_avatar()(获取头像) get_avatar() 函数用来获取置顶邮箱或许用户的头像代码,在评论列表中十分罕用。...

WordPress中制造导航菜单的PHP外围办法解说

WordPress 3.0 引入导航菜单性能, 让页面的导航和链接的治理变得简略易用. WP 向用户提供了菜单治理页面和多...

WordPress 自定义文章列表列的完成办法

上一篇,咱们应用 Meta Box 为文章增加了一个&ldquo;推荐指数&rdquo;字段。增加后用了一段工夫,仿佛不那么...

WordPress伪动态和中文标签支持配置办法

WORDPRESS博客站曾经运转快一年了,在伪动态上不断很纠结,空间默许不支持伪动态,网上找了很多办法,用404...

Wordpress完成单篇文章分页显示的办法

本文实例讲述了Wordpress完成单篇文章分页显示的办法。分享给大家供大家参考。详细剖析如下: 很多冤家都晓...

需求提交

客服服务