In my function file, I set the following:

if ( function_exists( 'add_theme_support' ) ) {
    add_theme_support( 'post-thumbnails' );
    set_post_thumbnail_size( 150, 50, true );   

And in the loop:

<?php the_post_thumbnail();  ?>

But the images are resized proportionally, using the smallest value. The crop is not working.


I change the function:

function resize_thumb () {
   add_theme_support( 'post-thumbnails' );
   set_post_thumbnail_size( 280, 80, true );

add_action ( 'after_setup_theme', 'resize_thumb' );

But the desire crop not happens.


In functions.php, I add just this line:

add_image_size( 'thumbnail-news', '190', '40', true );

And in the loop I add this line

<?php the_post_thumbnail( 'thumbnail-news' ); ?>

To resize old images, I use Regenerate Thumbnails plugin.

1 Answer 1


Contrary to Pieter, I'd say your if statement is correct (although, unnecessary). If it's a WordPress theme, then add_theme_support will likely exist!

Have you per chance added the images before setting the post thumbnail size? If so, you need to regenerate your images:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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