Title: Linking to Post Permalink
Last modified: June 18, 2020

---

# Linking to Post Permalink

 *  Resolved [sncs](https://wordpress.org/support/users/sncs/)
 * (@sncs)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/linking-to-post-permalink/)
 * Hello Jan Willem
 * I’m using the add_filter function in the child theme of twenty twenty to link
   all thumbnails to the posts.
 * Like “Example 2” on this page:
    [https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/#linking-to-post-permalink-or-larger-image](https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/#linking-to-post-permalink-or-larger-image)
 * This does not work with the default image. Do you have a solution for this?
 * Thanks
    Claudio
    -  This topic was modified 5 years, 11 months ago by [sncs](https://wordpress.org/support/users/sncs/).

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

 *  Plugin Author [Jan-Willem](https://wordpress.org/support/users/janwoostendorp/)
 * (@janwoostendorp)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/linking-to-post-permalink/#post-13005299)
 * Hello Claudio,
 * EDIT: I didn’t read it right. Let me research this a bit more.
 * Jan-Willem
    -  This reply was modified 5 years, 11 months ago by [Jan-Willem](https://wordpress.org/support/users/janwoostendorp/).
 *  Plugin Author [Jan-Willem](https://wordpress.org/support/users/janwoostendorp/)
 * (@janwoostendorp)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/linking-to-post-permalink/#post-13005642)
 * Hello Claudio,
 * Yes I secificly made this as an exception. But to enable you only have to register
   the custom add_filter included:
 *     ```
       add_filter( 'post_thumbnail_html', 'my_post_image_html', 10, 3 );
       add_filter( 'dfi_thumbnail_html', 'my_post_image_html', 10, 3 );
   
       function my_post_image_html( $html, $post_id, $post_image_id ) {
   
       	$html = '<a href="' . get_permalink( $post_id ) . '">' . $html . '</a>';
       	return $html;
   
       }
       ```
   
 * Let me know how it goes!
 * Jan-Willem
 *  Thread Starter [sncs](https://wordpress.org/support/users/sncs/)
 * (@sncs)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/linking-to-post-permalink/#post-13005702)
 * Hello Jan-Willem
    Great, it works, thank you!
 * Claudio
 *  Plugin Author [Jan-Willem](https://wordpress.org/support/users/janwoostendorp/)
 * (@janwoostendorp)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/linking-to-post-permalink/#post-13005714)
 * No problem 🙂

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

The topic ‘Linking to Post Permalink’ is closed to new replies.

 * ![](https://ps.w.org/default-featured-image/assets/icon-256x256.jpg?rev=1058491)
 * [Default Featured Image](https://wordpress.org/plugins/default-featured-image/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/default-featured-image/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/default-featured-image/)
 * [Active Topics](https://wordpress.org/support/plugin/default-featured-image/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/default-featured-image/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/default-featured-image/reviews/)

## Tags

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

 * 4 replies
 * 2 participants
 * Last reply from: [Jan-Willem](https://wordpress.org/support/users/janwoostendorp/)
 * Last activity: [5 years, 11 months ago](https://wordpress.org/support/topic/linking-to-post-permalink/#post-13005714)
 * Status: resolved