2013-10-14 85 views
1

我有縮略圖和大小啓用爲使在functions.php中:WordPress的無法正確裁剪縮略圖

add_theme_support('post-thumbnails'); 
add_image_size('post-thumbnail', 150, 150, true); 
add_image_size('featured-thumbnail', 360, 300, true); 

它們被稱爲正確的循環,儘管作物被設置爲true,我還沒有看到任何裁剪成指定尺寸的圖像,他們都「看似」成比例。每當我進行更改時,我都會重新生成縮略圖,但沒有任何效果。我已經搜索了很多答案,並且幾乎沒有修復(我不想使用插件並手動執行)。

任何想法?

回答

5

請試試這個:

if (function_exists('add_image_size')) { 
    add_image_size('post-thumbnail', 150, 150, true);// please give another name if its not major requirement of this 
    add_image_size('featured-thumbnail', 360, 300, true);// please give another name if its not major requirement of this 
} 

感謝。

+0

謝謝!我不知道爲什麼這有什麼不同,但它終於有效。再次感謝。 – bvcm

+0

你總是歡迎 –

+1

這段代碼在功能上與你原來的代碼沒有任何區別 - 它一定是你修復它的其他東西(我遇到了同樣的問題) – RichardAtHome