Support » Plugins and Hacks » Hacks » Getting A Custom Link on a Featured Image

  • $query = new WP_Query(array('cat' => 3, 'posts_per_page' => 20, 'meta_key' => '_thumbnail_id'));
    	while($query->have_posts()) :
        $query->the_post();
        the_post_thumbnail();
    	endwhile;

    Above you will find the code I used on a custom template page to output the thumbnails to specific posts. That’s first thing! It works like a charm. Now, I need to add the hyperlink on the image so that when the featured image is clicked, it will take my user back to the actual post. How do I do this?

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Getting A Custom Link on a Featured Image’ is closed to new replies.