Title: Featured Image Post Link
Last modified: August 19, 2016

---

# Featured Image Post Link

 *  [Matt Rittman](https://wordpress.org/support/users/mrittman/)
 * (@mrittman)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/featured-image-post-link/)
 * Well I’m tearing my hair out over such a simple issue. How the hell do you link
   the featured image to the post url!? There’s not ONE tutorial online about how
   to do this!!? I just want the stupid featured image to link to the post it’s 
   associated with. If anyone can help, I would be really happy.
 * Thanks.

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/featured-image-post-link/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/featured-image-post-link/page/2/?output_format=md)

 *  [Jarret](https://wordpress.org/support/users/jarretc/)
 * (@jarretc)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/featured-image-post-link/#post-1892342)
 * Which theme are you using?
 *  Thread Starter [Matt Rittman](https://wordpress.org/support/users/mrittman/)
 * (@mrittman)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/featured-image-post-link/#post-1892473)
 * It’s a theme I created.
 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/featured-image-post-link/#post-1892483)
 * try it with this:
 *     ```
       <?php
       if ( has_post_thumbnail()) {
         echo '<a href="' . get_permalink() . '" >' . the_post_thumbnail() .'</a>';
       }
       ?>
       ```
   
 *  Thread Starter [Matt Rittman](https://wordpress.org/support/users/mrittman/)
 * (@mrittman)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/featured-image-post-link/#post-1892488)
 * Thank you but that did not seem to work…
 * And I have this in my functions.php file:
    `add_theme_support( 'post-thumbnails');`
 *  Thread Starter [Matt Rittman](https://wordpress.org/support/users/mrittman/)
 * (@mrittman)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/featured-image-post-link/#post-1892490)
 * Here is my page. It looks like it’s putting a link after the <img> tag instead
   of before it…
 * [http://www.votechrisbrooks.com/news](http://www.votechrisbrooks.com/news)
 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/featured-image-post-link/#post-1892494)
 * try it with this (in the loop):
 *     ```
       <?php
       if ( has_post_thumbnail()) {
         echo '<a href="' . get_permalink($post->ID) . '" >';
         the_post_thumbnail();
         echo '</a>';
       }
       ?>
       ```
   
 *  Thread Starter [Matt Rittman](https://wordpress.org/support/users/mrittman/)
 * (@mrittman)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/featured-image-post-link/#post-1892496)
 * That worked perfect keesiemeijer 🙂
 * One question though…why is this not in the documentation? I figured a common 
   task like this would be referenced. And it seems like a lot of code to just add
   a link to the featured image. I mean, it’s not a crazy amount but you’d think
   it’d be a simple parameter to add. Your code should be on this page somewhere:
   
   [Function Reference – the post thumbnail](http://codex.wordpress.org/Function_Reference/the_post_thumbnail)
 * Thanks again man, I really appreciated it.
 *  [Rev. Voodoo](https://wordpress.org/support/users/rvoodoo/)
 * (@rvoodoo)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/featured-image-post-link/#post-1892503)
 * [http://go.rvoodoo.com/Wpthumb](http://go.rvoodoo.com/Wpthumb)
 * Is awriteup I did about linking thumbnails to posts….
 * One way is a function, another to simply wrap the thumbnail in a link
 * As for documentation, if you think the documentation is lacking, feel free to
   add to it! The Codex is written by volunteers.
 *  Thread Starter [Matt Rittman](https://wordpress.org/support/users/mrittman/)
 * (@mrittman)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/featured-image-post-link/#post-1892506)
 * Thanks Rev. Voodoo! I didn’t even think about that. I just might do it!
 *  Thread Starter [Matt Rittman](https://wordpress.org/support/users/mrittman/)
 * (@mrittman)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/featured-image-post-link/#post-1892512)
 * Rev. Voodoo, you might want to check your code on your blog… I get a parse error
   using your version…
 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/featured-image-post-link/#post-1892537)
 * No need, I added it to the Codex. I also added code for thumbnails linking to
   large image size
 *  [Jarret](https://wordpress.org/support/users/jarretc/)
 * (@jarretc)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/featured-image-post-link/#post-1892538)
 * mrittman, the Codex page that you linked to in your earlier responses does in
   fact have the code you were looking for.
 * If you visit [http://codex.wordpress.org/Function_Reference/the_post_thumbnail](http://codex.wordpress.org/Function_Reference/the_post_thumbnail)
   and scroll down to the Linking to the Post Permalink headline you’ll find the
   code 🙂
 *  [Jarret](https://wordpress.org/support/users/jarretc/)
 * (@jarretc)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/featured-image-post-link/#post-1892539)
 * Heh, good work keesiemeijer 😀
 *  Thread Starter [Matt Rittman](https://wordpress.org/support/users/mrittman/)
 * (@mrittman)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/featured-image-post-link/#post-1892554)
 * Awesome! Thanks for adding this!
 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/featured-image-post-link/#post-1892559)
 * you’re welcome. It was the first time I added to the Codex.

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/featured-image-post-link/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/featured-image-post-link/page/2/?output_format=md)

The topic ‘Featured Image Post Link’ is closed to new replies.

## Tags

 * [featured](https://wordpress.org/support/topic-tag/featured/)
 * [image](https://wordpress.org/support/topic-tag/image/)
 * [link](https://wordpress.org/support/topic-tag/link/)
 * [post](https://wordpress.org/support/topic-tag/post/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 18 replies
 * 5 participants
 * Last reply from: [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * Last activity: [14 years, 4 months ago](https://wordpress.org/support/topic/featured-image-post-link/page/2/#post-1892888)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
