Wednesday, November 19, 2008

Related Posts In Blogger With 3 Lines of Code

There are many 'Related Posts' solutions for blogger platform, like the one I have on my blog. Almost each one of them require lot of changes in the template code. Finally, I have discovered an excellent solution to this, which only requires 3 lines of code to be embedded in the template. Let's see how to implement this excellent way to show related posts in blogger.


Related Posts Widget for Blogger


Related Posts Plugin


Yu-Jie Lin has invented this excellent related posts plugin for blogger platform. You can install this solution in two ways.

1. Install widget in sidebar
2. Displaying related posts below blog posts

Method - 1: Installing Widget In Sidebar

Simply visit the Related Post Widget home page and click the 'Add Related Posts Widgets' button. Follow the instructions and done.

Method - 2: Displaying Related Posts Below Blog Posts

Alternatively, you can choose to display related posts below each blog post. To implement that following these 3 simple steps.

1. Open your blog template the find the following line in the template.


<div class='post-footer-line post-footer-line-3'/>
...
</div>


2. Just below this code add a line of code like this.


<div class='post-footer-line post-footer-line-3'/>
...
</div>
<div id='related_posts'/>


3. Go to end of the template and find </body> tag. Just above this tag add the following two lines of code.


<script src='http://www.google.com/jsapi'/>
<script src='http://brps.appspot.com/brps.js' type='text/javascript'/>
</body>


done...

This script will show a maximum of 10 related posts. The execution time is very less because the data is cached by the script on the server.

Related Posts with Thumbnails
Want to make sure you always get the latest updates on MintBlogger.com? It's totally free! Sign up, and we'll send the articles straight to your inbox. No spam, ever. Period.

Free Updates by Email Free updates by RSS (What is RSS?)

How smart is your Theme?  How good is your support? Check out ThesisTheme for WordPress.

The Ultimate Premium Wordpress Theme

Building a website was never the same with new Thesis 1.6. The Thesis Theme for WordPress is a high-quality template system that you can use to improve your site immediately.
  • Strong SEO - Expertly-coded HTML + CSS + PHP framework makes Thesis the strongest engine to power on-site SEO. The core SEO settings are activated automatically, the moment you install thesis on your website. Just set it and forget it. Check out Thesis SEO features now!

  • Flexible Design Options - With Thesis in your hand, you don't need to hire a web-developer to design your website or blog. Thesis killer design options gives you complete control over every aspect of appearance, layout, color and typography. See Thesis Design Options now!

  • Strongest Support Community - Thesis is supported by thousands of talented users ready to help you in forums. Stack of excellent video tutorials makes it easy to understand every concept in no time. Grab Thesis 1.6 Now!
blog comments powered by Disqus