How To Link Thumbnail To Post For Opening the Full Blog Post?
October 1st, 2016 | by Ravi Chahar || 2 Comments |
Most of the websites show the thumbnails with the excerpt of the blog post on the blog page. When you click on the thumbnail then you reach to the full blog post.
Have you ever thought why would it happen? How to link thumbnail to post so that it can directly take you to your blog post?
It can be done while developing a WordPress theme. But if your theme doesn’t have this feature then you can easily add it.
Before that, you need tp understand the WordPress theme file structure.
You Can Link Thumbnail To Post Using HTML.
Before adding the link, you should know how to add thumbnail in WordPress theme. There is a theme support code which would enable the add featured image option in your WordPress post editor.
But here, we are about to link post thumbnail to post. It can be done using the simple HTML and the permalink function of WordPress.
Step 1:- First of all, you have to find out the code which shows the thumbnail along with your blog post excerpt and read more button.
You will find the similar code like above. Though the value may vary but the function would be the same.
Step 2:- If you want to edit the blog page then open the index.php file from your theme folder and edit it.
Step 3:- Use the permalink function of WordPress and create a link to post thumbnail. The permalink code would be.
Step 4:- Now is the time to use the simple HTML. If you know about the link tag of HTML. i.e <a>. Then it won’t be a problem.
You have to use all the codes shown about in the HTML link tag.
The above code would link thumbnail to post and you would able to open your blog post just by clicking on the featured image.
If you’re using any different image size for the thumbnails then you would find the different value inside the_post_thumbnail(”); function.
Don’t worry about that. Just use the simple WordPress permalink function and the HTML link tag and you would accomplish your goal.
Isn’t That Easy To Link Thumbnail To Post?
It’s always good to make the thumbnail as a link because whenever your readers try to open your website then the more chances are to click on the visual content.
You may have noticed that many WordPress themes don’t have this feature. To solve this, you can add the code shown above. If you still face any problem, feel free to ask.