I'm buiding a site that lists the most recent posts on the front page, the site is a recompilation of interesting articles and images so it doesn't make sense to link to the individual post.
I currently have the title redirecting externally to the link, but I would also like to link externally via the post image.
I've set up a custum field "externalurl"
This is what I have so far in the loop.php which does not work:
<?php
if ( has_post_thumbnail() ){ ?>
<?php $thumbURL = get_post_custom_values('externalurl'); ?>
<a href="<?php echo get_attachment_link($thumbURL); ?>" rel="gallery" title="<?php the_title(); ?>">
<?php the_post_thumbnail(); ?>
<span class="view-large"></span>
</a>
<?php } ?>
Does anybody have any idea what I'm doing wrong? Any suggestions welcome.
Thanks in advance!