no problem to have 2 or more post thumbnails of different sizes.
but what is the “ref” attribute ? do you mean “rel” ?
anyhow – example from the :codex
<?php
if ( has_post_thumbnail()) {
$large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large');
echo '<a href="' . $large_image_url[0] . '" title="' . the_title_attribute('echo=0') . '" >';
the_post_thumbnail('thumbnail');
echo '</a>';
}
?>
mind that the_post_thumbnail()
will give you the full HTML for the image , to get other attributes, you will need to use get_the_post_thumbnail()
or get_post_thumbnail_id()
with wp_get_attachment_image_src
$fullsize = wp_get_attachment_image_src( get_post_thumbnail_id(), 'fullsize' );
$fixed_height = wp_get_attachment_image_src( get_post_thumbnail_id(), 'fixed_height' ) ;
// returns array in which :
echo $fullsize[0] ;// url of fullsize
echo $fixed_height[0] ;// url of fixed_height