Alchymyth,
Thanks for posting this. You’re a great asset to the community. Would I be able to add the URL to the thumbnail image as well, so that if the URL custom field has a value, it adds it to both the featured image on the post, and the thumbnail on the blog roll as well?
I’m guessing something along the lines of:
add_filter('post_thumbnail_html','add_external_link_on_page_post_thumbnail',10);
function add_external_link_on_page_post_thumbnail( $html ) {
if( is_singular() or is_page() ) {
global $post;
$name = get_post_meta($post->ID, 'ExternalUrl', true);
if( $name ) {
$html = '<a href="' . ( $name ) . '" target="_blank" >' . $html . '</a>';
}
}
return $html;
}