I am working on the WordPress Twenty Ten theme, and I want to display post thumbnails. I have followed the steps below:

  • Added following code in functions.php file:

    if ( function_exists( 'add_theme_support' ) ) { 
        add_theme_support( 'post-thumbnails' ); 
  • I have also defined post thumbnail size,

    set_post_thumbnail_size( 150, 150 );
  • And I configured the media settings from the admin panel of WordPress to not to crop image. but this is cropping the image.

  • Using this in loop.php file,


I do not want to crop the image. How can I do this? Please help where I am wrong in my process.

Thanks in advance.


IF you want to retrieve thumbnail in size that you had set with set_post_thumbnail_size() then call the_post_thumbnail() without passing any arguments.

That will default to named post-thumbnail size that that set_post_thumbnail_size() actually creates.

Also crop for this will be determined by third argument in set_post_thumbnail_size() (defaults to false) and is not tied to media settings (those control entirely different sizes of image).

| improve this answer | |

Maybe it's just a typo, use


instead of


Another thing is, I've never used this in the loop.php only in functions.php

| improve this answer | |
  • Thanks, But if i am using the_post_thumbnail(array(150,150)); in functions.php. It is displaying actual image size at lists of posts page.? But i need thumbnail size of 150*150.? – Dinesh Jul 1 '11 at 6:48
  • Ok, so you can try this: if ( function_exists( 'add_theme_support' ) ) { add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 150, 150 ); } and if this does not work for you, maybe there's a conflict with another function. – Murilo Jul 1 '11 at 7:15

A couple things to try:

  1. Create a new custom image size: add_image_size( 'my-custom-thumb', 150, 150 ); Play around with the dimensions, to see how WordPress reacts. There may be a collision, since there is already a 150x150 image size.

  2. Regenerate your thumbnails, using the Regenerate Thumbnails Plugin or the Ajax Thumbnail Rebuild Plugin.

  3. And, as @Rarst said: remove the array from the call to the_post_thumbnail(); either pass it no parameters, or pass it an image-size-name as an argument.

| improve this answer | |
  • +1 for regenerating thumbnails. This step is non-obvious the first time one delves into all this. – two7s_clash Jul 1 '11 at 17:52

Your Answer

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