Post thumbnail not working after regenerate

I have this setting in function.php

add_image_size( 'thumbnail-gallery', 185, 185, true );

It will display a square picture.

Read More

Everything is fine before I regenerate new size using “Regenerate Thumbnails” plugin.

After the process finished, the <?php the_post_thumbnail( 'thumbnail-gallery' ); ?> will return the original “big” url instead the regenerate url.

it does not crop. original file url. not square.

Related posts

Leave a Reply

2 comments

  1. Look at the wp-content/uploads/ directory. Does your cropped image exists there? (e.g. myimage-185x185.jpg). If not, you could try to call add_image_size() on the init action hook.

    functions.php

    function wpse27579_addImageSizes() {
        add_image_size('thumbnail-gallery', 185, 185, true);
    }
    add_action('init', 'wpse27579_addImageSizes');
    
  2. This work beautifly for me:

    add_theme_support( 'post-thumbnails' );

    set_post_thumbnail_size( 200, 300 );

    add_image_size( 'thumbnailGallerySmall', 145, 120 );

    The Integration Code

    <?php the_post_thumbnail('thumbnailGallerySmall');?>
    

    Try it.. and good luck