en el function.php del theme agregar el soporte

add_theme_support( ‘post-thumbnails’ );

se usa dentro del Loop así:

<?php if (  (function_exists(‘has_post_thumbnail’)) && (has_post_thumbnail())  ) {
 the_post_thumbnail();
} ?>

USO:
<?php the_post_thumbnail( $size, $attr ); ?>

Parameters

$size
(string/array) (Optional) Image size.
Default: ‘post-thumbnail’, which theme sets using set_post_thumbnail_size( $width, $height, $crop_flag );. Either a string keyword(thumbnail, medium, large or full) or a 2-item array representing width and height in pixels, e.g. array(32,32).
$attr
(array) (Optional) Array of attribute/value pairs. For details, search source for the function that the_post_thumbnail relies on: wp_get_attachment_image

More Options

the_post_thumbnail();                  // without parameter -> Thumbnail

the_post_thumbnail('thumbnail');       // Thumbnail
the_post_thumbnail('medium');          // Medium resolution
the_post_thumbnail('large');           // Large resolution

the_post_thumbnail( array(100,100) );  // Other resolutions

Leave a Reply