Wordpress无法调整上传图片的大小

时间:2016-09-25 11:43:48

标签: php wordpress

我想要调整缩略图图像。我将此代码添加到我的functions.php文件中

    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

1 个答案:

答案 0 :(得分:0)

上传新图片,或者您已经在wordpress中有图像。然后安装重新生成缩略图的插件。

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

安装此图像并重新生成图像。愿这对你有用。