1

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.

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');
  • yes. the generated images are there in wp-content. but WordPress just scale the image using css. – neotorama Sep 3 '11 at 1:54
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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