wpvidZ

Learn WordPress With Video Tutorials

  • Blog
  • Browse
    • Backup & Restore
    • WordPress Localhost
    • WordPress Hosting
    • WordPress themes
    • Version Updates
    • Plugin Tips
    • Security
    • Tutorials
    • WordPress SEO
    • WP Miscellaneous
    • Sitemap
  • WP 5+ Tutorial
  • Search
wpvidZ Blog Plugin Tips WordPress Related Posts Without Plugin

Plugin Tips

WordPress Related Posts Without Plugin

Last updated on February 18, 2017
Posted on October 19, 2010

How to add or show related posts under your blog post without installing additional plugin.

I have posted how to add breadcrumbs without plugin and my best breadcrumbs plugin if you want a plugin, a few days ago, and today, i want to show you, how we can actually display related posts, which is usually you can find under your blog post.

This tutorial uses a shortcode that will display related posts based on “tags”, using TwentyTen theme. Of course you can apply it in your own theme, as long as it has functions.php.


Example, Post A has “funny” as a tag, and the other post, Post B has the same “funny” as a tag.

When you click Post A, it will show after the post content, something like:

Related Posts:
1. Post B.

Related Posts section often helps to get better interlinking in your blog page, and can decrease bounce rate.

When your visitors read your post, they won’t soon go away, or close their browsers if they see many post titles options that may interest them to read.

Now if you want to use plugin for this, this Y.A.R.P.P (Yet Another Related Posts Plugin) used to be my best related post plugin.

So let’s create this related post under post without plugin (for demo, see my related post under this post):

Video:

  • Is my site loading fast? I use this shared hosting
  • Try my theme >

Step by step guide:

1. Dashboard → appearance → editor

2. Function theme which is functions.php file (always back up first)

3. Add this code. (download in .txt file)

Thanks to blue anvil.

4. Update File.
Now we want to call this function by displaying (echo) the shortcode after post content.

It means we must adding some codes in single.php.

5. Click single post file which is single.php, open it, and look for a line of code which said: (see image)

</div><!--#nav-below-->

Where to paste the code.

5. Right below this line, add this line:

<div id="relatedpost">
<h3>Related Posts:</h3>
<?php echo do_shortcode('[related_posts]');?>
</div><!--#relatedpost-->

6. Update file, and check your post. It should have related posts based on the same tags.

7. To stylize the css, you can modify anything you like, in this tutorial i use a simple one.

Add this line to your style.css and update the file.

#relatedpost h3{margin:25px 0 10px 0;}

That’s it, modify, stylize as you like to fit your theme color, etc.

add code link plugins twentyten

Latest Posts

  • Twenty Nineteen Theme Full Tutorial – Creating a Website
  • Uninstall W3 Total Cache Plugin – Incredibly Easy!
  • Create WordPress Website 2018 on SiteGround Genesis
  • WordPress Noopener Noreferrer Rel Attribute Quick Fix
  • WordPress CDN Setup with MaxCDN and W3 Total Cache Plugin
  • Twenty Seventeen One Page Parallax Scrolling Website Style
  • How To Add Google Map in WordPress Contact Page
  • WordPress 4.7 Justify Text and Underline
  • Twenty Seventeen Footer “Proudly Powered By WordPress” Text
  • How To Add YouTube Subscribe Button To WordPress Website
← Notify Me of Followup Comments Via Email- Plugin
→ ReplyMe Plugin- Your Comment on The Post Has a New Reply

Comments

  1. Curious Little Person says

    October 20, 2010 at 6:48 am

    nice, i actually use the YAARP plugin to show the related posts on my new blog…

    Will need to try this technique as I’ll have one plugin less with my thesis theme..

    Thanks for this valuable info..

    Cheers
    Sandeep

    • Kimi says

      October 20, 2010 at 7:44 am

      Yes, Y.A.R.P.P was also my best fav plugin for related post.

      If you want to work without plugin, it is also easy to implement in our blog with the tut above 😀

      Thanks for coming by Sandeep.

  2. Goutham says

    October 20, 2010 at 8:12 am

    Nice tutorial. 🙂 Thanks for the share. 🙂

    • Kimi says

      October 20, 2010 at 8:20 am

      Hey Goutham,

      Thanks for your nice words and commenting 🙂

  3. Bryan says

    October 20, 2010 at 10:58 am

    hey kimi,

    any ideas for adding this to thesis?

    • Kimi says

      October 20, 2010 at 5:52 pm

      Yeah Bryan, i have already put the post in schedule actually, it will be published in a few days.

      • Bryan says

        October 22, 2010 at 10:12 am

        ooh thx kimi. looking forward to it 🙂

  4. Kavita says

    October 21, 2010 at 7:42 am

    I am using YARPP plugin. I wish had read this post much earlier. I always appreciate adding codes manually without using plugins. Thanks for the post anyway, Kimi

    • Kimi says

      October 21, 2010 at 8:49 am

      Same here Kavita, I also prefer adding stuff manually.

      Thank you for visiting and leaving a comment, Cheers.

  5. Vinay says

    October 21, 2010 at 9:39 pm

    YARPP is one of the best related posts plugin! Nice share Kim 🙂

    • Kimi says

      October 22, 2010 at 1:50 pm

      Same here Vinay, I used YARPP too.

      Thanks for commenting.

  6. Imran@TechiesBlog says

    October 22, 2010 at 7:54 pm

    Hi Kimi,

    presently I am using YARPP plugin, I will doing some slight makeover of my blog and planing to use Similar Post plugin. But required you assistances to eliminate few plugins and maintain the functionality of the blog. Moreover I am also using thesis theme.

    Thanks for Sharing
    -Imran

    • Kimi says

      October 22, 2010 at 10:51 pm

      Hey Imran,

      I already scheduled Thesis tutorial on this, stay updated, will be published in a few days.

      Thanks!

      • Imran@TechiesBlog says

        October 27, 2010 at 5:45 am

        Thanks Kimi I will be waiting for it.

        However I am not using Blogussion thesis skin it is my custom made skin, yeh u are right I have take few functionality of Blogussion.

        It has become a hobby for his day where I see good I want to implement on my blog. It is more kind of experimentation and learn thesis.

        • Kimi says

          October 27, 2010 at 7:21 am

          I also like my Thesis clean.

          Thanks for stopping by 😉

  7. Aks says

    October 24, 2010 at 1:09 pm

    Awesome tutorial on adding related posts.

    • Kimi says

      October 25, 2010 at 8:43 am

      Thanks!

  8. anuj@webtricks says

    March 2, 2011 at 3:53 pm

    is this trick work on thesis theme

    • Kimi says

      March 3, 2011 at 9:10 am

      Hi Anuj

      Yes, but we need to modify a bit, here is a quick link on my Thesis tutorial: https://www.wpvidz.com/add-related-posts-in-thesis-theme-without-widget/

      I hope this helps.

      Kimi.

  9. Toi says

    March 9, 2011 at 3:45 am

    Thanks I’m trying to reduce the number of plugins I use 🙂

  10. Naziman says

    April 11, 2012 at 10:46 pm

    Thanks but actually i want related post by category if, category no other post, i want to make it by tag. but i don’t know how.

Trackbacks

  1. Friday Gems and #FF–NO 3 | SEO MMO Tips says:
    November 9, 2010 at 8:10 am

    […] WordPress Related Posts Without Plugin and WordPress Themes For Law Firms by Kimi […]

Comment form on this post is closed after 60 days.

Search

Worth Reading

  • Uninstall W3 Total Cache pluginUninstall W3 Total Cache Plugin - Incredibly Easy!
  • Backup WordPress Database Automatically Using WP DB Backup
  • Google Publisher Plugin - For AdSense and Webmaster Tools
  • Database error : MySQL server has gone away - Broken Link Checker Plugin
  • Plugin to Increase WordPress Blog Speed
  • SEOpressor plugin update- Version 4.3.02 Some of my Problems
  • Plugin to Move WordPress Site or Blog
  • Wordpress Autopost Plugin - Updating Blog Automatically
  • Reply Me Plugin Setting - One line to increase your traffic
  • All in one seo pack alternative plugin

Backup & Restore

Backup WordPress Without a Plugin or FTP

Export WordPress Database using phpMyAdmin

BigDump Alternative – When BigDump Failed Importing Large WP Database

At This Place The Current Query Includes More Than 300 Dump Lines

View All..

Live Online Website

View All..

Offline Installation

How to Upload WordPress localhost to live server manually

Steps to Install WordPress on Windows 8 and WAMP 2.4

Install WordPress on Mavericks OS X 2014

Maximum upload file size in WAMP WordPress

View All..


WPvidz Hosting Image

  • About Me
  • Contact
  • Affiliate Disclosure
  • Privacy Policy
  • Term of Use

Copyright© 2023 wpvidz.com SG2021 | sitemap.xml


WPvidz.com is independent from WordPress.org but is proudly powered by WordPress & its block-based editor (Gutenberg)

WpvidZ.com uses cookies" to give you the best browsing experience possible. If you click "I Accept" below then you are consenting to this. For more information about your privacy settings on this website, please visit the Privacy Policy page. I Accept