this is what i currently have:
<a id="single_image" href="<?php the_post_thumbnail('full'); ?>"><?php the_post_thumbnail('home-port'); ?> </a>
the output link doesn't work and this is left above my images: ">
Andrew Wong answers:
<?php the_post_thumbnail('full'); ?> = Output the whole URL from <img src... >
You need to look for the URL of the post thumb only.
<?php
$url = wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); // GET POST THUMBNAIL URL
?>
<a id="single_image" href="<?php echo $url; ?>">
<?php the_post_thumbnail('home-port'); ?>
</a>
Daniel Bell comments:
Thanks a lot! Worked like a charm, and thank you for the brief explanation. Voted for you.
Nilesh shiragave answers:
Use this code
<?php
$large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full');
echo '<a id="single_image" href="' . $large_image_url[0] . '" title="' . the_title_attribute('echo=0') . '" >';
the_post_thumbnail('home-port');
echo '</a>';
?>
Romel Apuya answers:
try this one:
<?php $src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full');?>
<a id="single_image" href="<?php echo $src[0]; ?>"><?php the_post_thumbnail('home-port');?></a>