How To Insert Related Post Between Paragraphs In WordPress

A blogger, you should know that posting or displaying related post (or posts) can increase the page views of a website or blogsite. Do you agree? And without any infograph or statistical studies I am sure that most of these bloggers used WordPress as for their CMS.  I know there are great and cool free plugins available that can do the job – by posting the most relevant and related post for a certain article.  There’s the nrelate plugin, Related Posts (YARPP), SEO ALRP, and many more.  But I haven’t found (yet) a plugin that will display related post between the paragraphs.  Why do I wanted to have such feature when I already have nrelate plugin all over on each of my posts?  The answer is I want to gain more page views and possibly decrease my website’s bounce rate.  This is somekind of an experiment on my part and I am willing to share it with you if you want.

Related Contents

This is the fruit of my research and with a little knowledge in coding I was able to make it work on two of my blogsites.  And all we have to alter is one of the files from your theme which is the single.php.  I urge you and it is recommended that you backup first this file before you proceed with the next steps.

A must read:   How To Watch Flash Videos From iPhone, iPod Touch, iPad


WARNING:The following code that I will be sharing with you was tested on my site. You can use the code as well at your own risk. The author will not be held liable for anything if you somehow break your theme’s layout or content.  That is why I urge you to backup first the single.php before going to the next steps.

Themes EditorI assume now that you have already backed up your single.php and we can now proceed.  You can choose any methods you want where you are most comfortable when editing the file. But on this article I will be showing you on how to edit it within your WordPress CMS application.  Do this by clicking Dashboard -> Appearance -> Editor.  Once you click this, your display will redirect you to your Theme’s editor page. Note that this will load your current and default WordPress theme.  Most often than not, the default page you will see once the page loads it the style.css or your theme’s stylesheet.

On your right panel, look for the single.php, this is where the fun begins.  Click the single.php link and once the page loads, look for this code:

Delete it and replace it with the following codes:

Save your work and check now your contents or posts.  You will now see something like the image below:

Related posts Sample

Basically that’s it.  You can further customize it if you want just remember to always have your back up ready.

If you are using a WP-Cache or any caching plugin, I suggest that you clear it right after you have implemented this code.  I have no plans yet on creating a plugin out of this, basically it’s because I am quite fully occupied right now to code.

Thanks to Amit Shaw of iTechcode.com for inspiring me to come up with this. :)


Hi, I am Arsie "RC" and I am a freelancer tech blogger. Most of my articles and posts are tech-related stories and most of it covers the latest Android or Apple apps, gadget reviews, Microsoft updates social media updates, tips and tricks, SEO and making money online. If you wish to contact me, go ahead and visit our contact page. You can follow my updates on Twitter, Facebook, or on Google+ profile. You can also check my other tech blog site for more informative news.

Trackbacks/Pingbacks

  1. WordPress如何在文章正文中插入相关文章 ¦ Wper.So - September 13, 2012

    [...]  Arsie Organo的这篇文章提供了一个简便的方法。本文在这篇文章的基础上对代码进行了适当的修改和注释。 [...]

Leave a Reply

CommentLuv badge