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

I want resize thumbnail image. I add this code my functions.php file

    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'));

And i set thumb size on wordpress settings. But wordpress save a full image. enter image description here

Upload new image or if you have images in the wordpress already. Then install plugin of regenerate thumbnails.

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

Install this and regenerate images. May this will work for you.