• So I just recently decided to experiment using the featured image for creating a thumbnail for my posts. However, I’d like to have some control over where the thumbnail linked to.

    For example I have a thumbnail image of a youtube video, and I’d like it to link to http://www.youtube.com/v/nBFhvrAOFqY instead of my post. Other times I much just want it to link to a larger version of the image, and other times simply the post itself. i.e. I need some sort of custom field to enter for my thumbnail/featured post image.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter eamethan

    (@eamethan)

    Still messing around with this and having no luck. Still could use help.

    I am having this same issue, how do you set a custom link destination on a featured image?

    I would suggest using something like the custom meta function to set a video link variable. Then I would do something like:

    <a href="<?php $housekey ="youtubeurl"; echo get_post_meta($post->ID, $housekey, true); ?>" title="<?php the_excerpt(); ?>">
    
    <?php the_post_thumbnail( array(999,159) );?>
    
    </a>

    I didn’t test this out, but you get the idea. Basically use the the_post_thumbnail() to display the featured image in your correct size, then use the get_post_meta to hold and pull a url with your video in it.

    Of course put all this into your loop.

    Hope that helps!
    max

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Featured Image Linking (custom url)’ is closed to new replies.