2016-09-25 299 views
0

我想調整縮略圖圖片的大小。我添加此代碼我functions.php文件
Wordpress無法調整上傳圖片的大小

set_post_thumbnail_size(500, 500, true); 

    add_theme_support('post-thumbnails'); 
    add_image_size('custom-small', 500, 500, true); 
    add_image_size('custom-medium', 500, 500, true); 
    add_image_size('custom-large', 500, 500, true); 
    add_image_size('thumbnail', 500, 500, true); 
    add_image_size('medium', 500, 500, true); 
    add_image_size('medium_large', 500, 500, true); 
    add_image_size('large', 500, 500, true); 
    add_image_size('post-thumbnail', 500, 500, true); 
    add_image_size('thumbnail', 500, 500, true); 

    the_post_thumbnail('custom-small');  
    the_post_thumbnail('custom-medium');  
    the_post_thumbnail('custom-large');  
    the_post_thumbnail('thumbnail');  
    the_post_thumbnail('medium'); 
    the_post_thumbnail('medium_large');  
    the_post_thumbnail('large');  
    the_post_thumbnail('post-thumbnail'); 
    the_post_thumbnail('thumbnail');  


    add_theme_support('post-formats', array('video')); 

我就定於WordPress的設置拇指大小。但wordpress保存完整的圖像。 enter image description here

回答

0

上傳新的圖片,或者如果您在WordPress已經有了圖像。然後安裝重新生成縮略圖的插件。

https://wordpress.org/plugins/regenerate-thumbnails/

安裝此並重新生成圖像。願這能爲你工作。

+0

是的。我試過了。這是行不通的 – balkondemiri

+0

你的原始圖像大小是多少? –