WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have this setting in function.php

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

It will display a square picture.

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.

share|improve this question

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.


function wpse27579_addImageSizes() {
    add_image_size('thumbnail-gallery', 185, 185, true);
add_action('init', 'wpse27579_addImageSizes');
share|improve this answer
yes. the generated images are there in wp-content. but WordPress just scale the image using css. – neotorama Sep 3 '11 at 1:54

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.