Title: Title hyperlink with Thumbnail Template
Last modified: August 22, 2016

---

# Title hyperlink with Thumbnail Template

 *  Resolved [bmg](https://wordpress.org/support/users/bridgetg/)
 * (@bridgetg)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/title-hyperlink-with-thumbnail-template/)
 * Hey
 * Everything is working perfectly, however, the thumbnail links to the related 
   post but the actual title of the post is not an active link. How do I add the
   url to the title of the post?
 * I’m assuming it’s in functions-thumbnail.php
 * I see the thumbnail has this code
 *     ```
       $output .=  "<a href='$url' title='$post_title'>$gallery_image</a>\n";
       			}
       ```
   
 *  not sure how to format this for the title and what I should replace.
 * Thanks!
 * [https://wordpress.org/plugins/related-posts-by-taxonomy/](https://wordpress.org/plugins/related-posts-by-taxonomy/)

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

 *  Plugin Author [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/title-hyperlink-with-thumbnail-template/#post-5369634)
 * Hi bmg
 * Can you explain more about what you mean by “but the actual title of the post
   is not an active link.” Does it mean the post doesn’t have a title, or something
   else?
 * The file is correct but the code you posted is for related post thumbnails in
   a feed. Maybe you meant this:
 *     ```
       $image_output =  "<a href='$url' title='$post_title_attr'>$gallery_image</a>";
       ```
   
 *  Thread Starter [bmg](https://wordpress.org/support/users/bridgetg/)
 * (@bridgetg)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/title-hyperlink-with-thumbnail-template/#post-5369645)
 * Sorry, I meant that the title isn’t an active link to the post, it just shows
   up as text. So in order to view the post, I have to click the thumbnail. I would
   like to be able to click both the thumbnail and the title of the story to link
   me to the post page.
 *  Plugin Author [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/title-hyperlink-with-thumbnail-template/#post-5369653)
 * No problem 🙂
 * Try it with this in your theme’s functions.php
 *     ```
       add_filter( 'related_posts_by_taxonomy_caption', 'link_related_caption', 10, 3 );
       function link_related_caption( $caption, $related, $args ) {
           $caption = '<a href=' . get_permalink( $related->ID ) . '>' . $caption . '</a>';
           return $caption;
       }
       ```
   
 * If you need it with the post date (as in the [other topic](https://wordpress.org/support/topic/post-date-under-post-title))
   use this:
 *     ```
       add_filter( 'related_posts_by_taxonomy_caption', 'link_related_caption', 10, 3 );
       function link_related_caption( $caption, $related, $args ) {
       	$date = '<span class="related-post-date">';
       	$date .= get_the_date( get_option( 'date_format' ), $related->ID );
       	$date .= '</span>';
   
       	$caption = '<a href=' . get_permalink( $related->ID ) . '>' . $date . $caption . '</a>';
       	return $caption;
       }
       ```
   
 * [http://keesiemeijer.wordpress.com/related-posts-by-taxonomy/filters/#related_posts_by_taxonomy_caption](http://keesiemeijer.wordpress.com/related-posts-by-taxonomy/filters/#related_posts_by_taxonomy_caption)

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

The topic ‘Title hyperlink with Thumbnail Template’ is closed to new replies.

 * ![](https://ps.w.org/related-posts-by-taxonomy/assets/icon.svg?rev=1115231)
 * [Related Posts by Taxonomy](https://wordpress.org/plugins/related-posts-by-taxonomy/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/related-posts-by-taxonomy/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/related-posts-by-taxonomy/)
 * [Active Topics](https://wordpress.org/support/plugin/related-posts-by-taxonomy/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/related-posts-by-taxonomy/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/related-posts-by-taxonomy/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * Last activity: [11 years, 9 months ago](https://wordpress.org/support/topic/title-hyperlink-with-thumbnail-template/#post-5369653)
 * Status: resolved