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

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.

share|improve this question

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:


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.