• Picking up where the Featured Image post left off – I’d like to be able to actually link the image to a separate url than the post itself.

    I’ve created a custom field for the blog post called url and I have this code in the post_loop_template.php page:

    <div class="featured-image">
    		<?php $url = get_post_meta($post->ID, 'url', true);?>
    <a href="<?php echo $url ?>" title="<?php the_title(); ?>">
    					<?php the_post_thumbnail('thumbnail'); ?>
    					</a>
    	</div>

    But the url is not populating. There’s nothing in the a href=””

    What am I missing?
    Thank you!

    https://wordpress.org/plugins/posts-in-page/

The topic ‘Add external link to Featured image’ is closed to new replies.