set_post_thumbnail_size not cropping featured images, but reducing proportionally

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:

Read More
<?php the_post_thumbnail();  ?>

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

UPDATE

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.

SOLVED

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.

Related posts

Leave a Reply

1 comment