wordpress上傳圖片不自動(dòng)生成縮略圖的解決方法

因?yàn)檎军c(diǎn)不需要顯示這么多圖片,只需要原圖就OK了,所以就要修改下媒體設(shè)置。打開(kāi)設(shè)置->媒體,將不需要的縮略圖寬度高度都設(shè)置為0就可以了。如下圖:
但是這樣設(shè)置之后,還是會(huì)生成其它分辨率的縮略圖,筆者猜測(cè)應(yīng)該是主題的問(wèn)題,于是就去主題內(nèi)查找,筆者用的主題是themolio。后來(lái)在主題文件的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就是增加縮略圖設(shè)置的方法,根據(jù)需要注釋掉即可。其它主題也可以依此類(lèi)推,只要搜索關(guān)鍵詞add_image_size,應(yīng)當(dāng)就能找到縮略圖的設(shè)置。
最后生成多張縮略圖的問(wèn)題就搞定了。
友情提示
如果日后有需要縮略圖,可以在媒體->媒體庫(kù)->選擇需要的圖片點(diǎn)編輯->編輯圖片,然后就可以裁剪圖片了。最后報(bào)下wordpress和使用主題的版本:
wordpress是3.4.1版本
主題是Themolio,版本是1.2
相關(guān)文章
CyberPanel安裝WordPress并配置偽靜態(tài)規(guī)則
下面教你如何在 CyberPanel安裝WordPress以及配置偽靜態(tài),需要的朋友可以參考下2023-12-27- 這篇文章主要介紹了wordpress無(wú)法安裝更新主題插件的解決辦法,需要的朋友可以參考下2020-12-27
WordPress必備數(shù)據(jù)庫(kù)SQL查詢(xún)語(yǔ)句整理
發(fā)現(xiàn)幾條比較實(shí)用的,適合 WordPress 實(shí)用的SQL語(yǔ)句。于是就趕緊收集分享出來(lái)了,需要的朋友可以參考下2017-09-23wordpress在安裝使用中出現(xiàn)404、403、500及502問(wèn)題的分析與解決方法
wordpress是很多新手站長(zhǎng)搭建個(gè)人博客最喜愛(ài)的程序,但是最近在使用WordPress的時(shí)候遇到了一些問(wèn)題,所以想著將遇到問(wèn)題總結(jié)分享出來(lái),下面這篇文章主要給大家介紹了關(guān)于wo2017-08-11WordPress取消英文標(biāo)點(diǎn)符號(hào)自動(dòng)替換中文標(biāo)點(diǎn)符號(hào)的優(yōu)雅方法
這篇文章主要介紹了WordPress取消英文標(biāo)點(diǎn)符號(hào)自動(dòng)替換中文標(biāo)點(diǎn)符號(hào)的優(yōu)雅方法,需要的朋友可以參考下2017-04-04- 這篇文章主要給大家介紹了wordpress自定義上傳文件類(lèi)型的方法,如WordPress默認(rèn)允許上傳 .exe 后綴名的可運(yùn)行文件,那么我們?cè)趺唇褂脩?hù)在WordPress后臺(tái)發(fā)表文章時(shí)上傳 .e2016-12-19
- 大家可能發(fā)現(xiàn)了當(dāng)實(shí)現(xiàn)了前端用戶(hù)中心,后臺(tái)控制面板就失去了作用,那么限制其他用戶(hù)進(jìn)入后臺(tái)控制面板就很有必要了!那么我們要怎么做呢?通過(guò)下面這篇文章分享的方法后,只2016-12-19
WordPress實(shí)現(xiàn)回復(fù)文章評(píng)論后發(fā)送郵件通知的功能
這篇文章主要介紹了WordPress實(shí)現(xiàn)回復(fù)文章評(píng)論后發(fā)送郵件通知的功能,涉及wordpress針對(duì)評(píng)論與郵件的相關(guān)操作技巧,需要的朋友可以參考下2016-10-11WordPress使用自定義文章類(lèi)型實(shí)現(xiàn)任意模板的方法
這篇文章主要介紹了WordPress使用自定義文章類(lèi)型實(shí)現(xiàn)任意模板的方法,可通過(guò)自定義文章類(lèi)型來(lái)實(shí)現(xiàn)任意模版的使用,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2016-10-11WordPress后臺(tái)地址被改導(dǎo)致無(wú)法登陸后臺(tái)的簡(jiǎn)單解決方法
這篇文章主要介紹了WordPress后臺(tái)地址被改導(dǎo)致無(wú)法登陸后臺(tái)的簡(jiǎn)單解決方法,簡(jiǎn)單分析了后臺(tái)無(wú)法登陸的原因與相應(yīng)的解決方法,涉及針對(duì)wordpress配置項(xiàng)的簡(jiǎn)單修改,需要的朋友2016-10-11