WordPress - add_image_size does not work?

5.7k Views Asked by At

Following this guide, I want to add an additional image size:

if ( function_exists( 'add_theme_support' ) ) { 
    add_theme_support( 'post-thumbnails' );
    set_post_thumbnail_size( 150, 150, true ); // default Post Thumbnail dimensions (cropped)

    // additional image sizes
    // delete the next line if you do not need additional image sizes
    add_image_size( 'category-thumb', 500, 500 );
}

But I don't see this size (500 X 500) of image is created in /wp-content/uploads/... after uploading new images.

Any ideas what I have missed?

3

There are 3 best solutions below

1
On BEST ANSWER

Just add this code.

if (function_exists('add_image_size')){
add_image_size( 'category-thumb',500,500, true);

}
0
On

make sure that gd2 extension is enabled

1
On

this works only for new uploaded images! just delete the old ones and upload them again.