How to Display Related Posts Without Plugin in WordPress?

How to Display Related Posts Without Plugin in WordPress?

display Related Posts Without PluginMany WordPress webmasters want to display Related Posts at the end of their WordPress posts, but without plugin. Today, we’ll show you how to display related posts without plugin in WordPress.

Generally, you must show something useful at the end of your post in WordPress. That will suggest the user to browse more in your website and stay longer. If you display some related articles, chances are that visitor will click some useful article looking at the title of that.

To display related posts in WordPress, there are many ways.

Some themes have inbuilt feature of displaying related posts. Just enable that under Appearance -> Customize or Theme Options and that’s it.

Then, we’ve many WordPress plugins to display related posts. Their features, comparison, pros and cons will be discussed in some other post.

Today, we’ll see how to display related posts without plugin in WordPress.

We’ll implement the same by using small code-snippet. Just put this code in your theme single.php file, where you want to display related posts.

This post will display 5 related posts in WordPress using tags. You can change this limit from 5 to any number by modifying the above code.

READ  How to protect wp-config.php file in Wordpress from Hackers?

Warning: Before you make any changes in your theme single.php file, be sure to take its backup. You can use this backup file if things goes against you.

Instead of edting single.pgp file, there are many WordPress plugins, which allows you to display any code at the end of post or at the beginning of post. You can try Ad inserter WordPress plugin to do so.

 

How to Display Related Posts Without Plugin in WordPress?
5 (100%) 4 votes

2 thoughts on “How to Display Related Posts Without Plugin in WordPress?

  1. 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.

    • Hello Mike,

      It happens many times as sometimes CSS files from theme or plugins clash with other code.
      Try clearing cache and see the results.

      If you still face the problem, you can try some Related Post plugin which provides different options. I prefer using Yuzo Related Post https://wordpress.org/plugins/yuzo-related-post/
      This plugin gives many options to suit any website.
      Try it. It’s free.

      Hope it will help you.
      Admin

Leave a Comment


Subscribe Updates, Its FREE!

Email ID:

+Admin