How to display or add Related Posts in WordPress without Plugin

How to display or add Related Posts in WordPress without Plugin

How to add Related Posts with Thumbnails in WordPress without Plugins

In this article will teach you how to add related posts with thumbnails to your blog  single post page without using any plugins, keeping everything simple, light and accessible. Related post are simple and small thing but it play a major role and very important from many perspective.  before showing you How to add related post i want to tell you why it’s so necessary and important.

Why Show Related Post in articles and  Why Related post are Important?

  • Bounce rate essentially represents the percentage of initial visitors to a site who “bounce” away to a different site, rather than continue on to other pages within the same site. By adding Related  post you can intrigued your readers/user to your site and it will decreasing your bounce rate.
  •  This can have a significant impact on your Adsense earning. More page session simply means more Adsense revenue.
  • You are increasing Your Page views per Session.

Now Lets add Related Post in post page.

You can display the Related Posts based on Categories or Tags. I personally recommended  to you  display the ‘Related Posts’ based on category although i will be showing you both the methods i.e. using category and tags. Choose the one which suites your blog the best.

Copy and paste the code below in file  single.php where you want to display related posts.

Related Posts by Category

This algorithm would find some other posts within the same category as the current post, and it will list them as related posts. The advantage of this technique is that you will never have a blank spot for your related posts section.

You can manage ‘posts_per_page’=> 4, values according  to your need.

Related Posts by Tags

Each posts may be have number of tags with multiple keywords. This algorithm would result in a list of posts with one or more similar tags with current post. You can paste this code anywhere you like in your  single.php but it is recommended to be placed right above the comments section.

The CSS

You can modify this CSS, as you wish according to your them.

 


About Vijay Dhanvai

A passionate blogger by heart and mind, I have been working in this field for 7 years now. A WordPress Professional, web developer and designer who intends to guide his readers about Web Design, WordPress, Blogging, Web Development, and more.

2 Comments

  • Mike says:

    Hello,
    I’m a beginner in WorldPress.
    I’d like to show Related Posts.
    In the main menu I have Category A, and in Category A – Subcategories A, B and C. The posts are in Category A, but they can also be present in all 3 Subcategories.
    When choosing one of the Related Posts something goes wrong and the posts from the initially chosen Subcategory don’t show correct anymore.

  • luigi says:

    Hi, is it possible to limit them by date? Show only those of the last year?

Leave a Reply