0

Currently i have these lines in functions.php and my home page respectively:

add_theme_support( 'post-thumbnails' );
add_image_size( 'square', 252, 252, true );

//

if ( has_post_thumbnail()):
      the_post_thumbnail( 'square' );
    endif; 

Then regenerate thumbnails plugin resizes images to 252 x 252.

How do I display cropped thumbnail images and not featured?

Just to add , im using ACF custom fields plugin and part of that tinkers with the featured iamges, so it maybe possibly re-writing native logic in how to handle images. If anyone has been in a similar situation, please let me know if ou found a work around. Thanks!

  • The code looks correct. The issue must be somewhere else... – Hendrik Luehrsen Aug 29 '14 at 11:44
1

If I understand correctly, you can try with this code.

add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 252, 252, true);

//enter code here

if ( has_post_thumbnail()):

      the_post_thumbnail();

endif; 

OR

if ( has_post_thumbnail()):

      the_post_thumbnail(array(252, 252));

endif; 

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.