Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

How can I set full image thumbnail on category pages? Image should be small in dimensions but not been cropped. Currently my theme WP-Davici (Solostream) use "Get The Image" plugin to generate thumbnail. you may have a look at http://ideabroad.com/

share|improve this question

1 Answer 1

up vote 1 down vote accepted

These are two different things:

How can I set full image thumbnail on category pages

vs

Image should be small in dimensions but not been cropped.

In order to display the full-size image thumbnail, use:

<?php the_post_thumbnail( 'full' ); ?>

In order to display a box-resized, rather than hard-cropped, image, you need to tell WordPress to box-resize the image rather than hard-crop it, via the add_image_size() call used to create the thumbnail image size..

  • Hard-cropping an image means that WordPress will make the image exactly the size specified by the $width and $height parameters passed to add_image_size().
  • Box-resizing an image means that WordPress will resize the image proportionally, until the longest dimension matches the size specified by $width or $height, as appropriate.

You define this action in the add_image_size() call in functions.php, like so:

<?php
add_image_size( $name, $width, $height, $crop );
?>

The fourth parameter, $crop, specifies whether to hard-crop ( true ) or to box-resize ( false ) the image.

share|improve this answer

Your Answer

 
discard

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.