How to add Related Posts to Blogger (Tuesday Tips #1)

Today is the first in our Tuesday Tips series. These are posts which will contain, erm…tips and be posted on every erm…Tuesday. I’ll try to cover tips and tricks for all levels of bloggers, from n00b to advanced and where possible we’ll try and cover the Blogger.com and WordPress platforms.

Update
cheeseIf you came here looking for your cheese. I moved it.

The point of this series is to help you to become a better blogger and get more traffic on your blog. After spending a bit of time snooping around in the Afrigator database, I noticed that we had a large number or users on the Blogger.com platform, so I figured a tip for Blogger would be a great place to start.

How to display related posts on your blog post

When someone comes to your blog and reads an article they like, chances are that they want to read some more of your writing. The question you face is how to get your content to them in a very easily understandable way. One way to do is to show some content  that is similar to what the jut finished reading.

When you create a new post in Blogger, you can label it. Each of these labels acts as a category. So what we’re going to do now will display related posts by category

Log in to Blogger.com
Select Layout from the menu

picture-26

Click on Edit HTML

Once the Editor loads, please click on Expand Widget Templates

picture-21
Don’t panic, you won’t break anything( I hope)
Next, copy all of the code in the Editor Window. Open Notepad (or Text Edit if you’re on a Mac) and paste your code there, just in case you need a backup.
Go back to Blogger and search for the following line of code in the editor (using Control + F to search)

<data:post.body/>

8. In the Editor, add the following text immediately after <data:post.body/>
<!--Start of Related Articles Text-->
<!--End of Related Articles Text-->

This is simply place holder text and will let you find the related text code if ever you decide to remove it or edit it.

Ok, now that you’ve set aside some space for your nifty new code, let’s go and get it. Click on this link to find the code:

http://kendhin.890m.com/relatedpost.txt

Copy all of the text on the page and paste it between the two areas you set aside in blogger.

<!--Start of Related Articles Text-->
Paste the code you just copied in here
<!--End of Related Articles Text-->

Click on Save Template and you’re done ;)

Your blog post will now display related articles based on how you have labelled your posts.

You can control how many labels and posts you would like displayed by searching for the following text:
maxNumberOfPostsPerLabel
maxNumberOfLabels

I have mine set to 2 Labels and 2 posts per label, so the code looks like this:

maxNumberOfPostsPerLabel = 2;
maxNumberOfLabels = 2;

So, next time someone reads a post on your blog, they’ll see something like this:

picture-22
And that’s how to display related posts by category in under 5 minutes ;) If you have any tips you would like to see here, please drop us a comment have any tips or tricks that you would like to share, then pleas email me to support@afrigator.com and who knows your tip might be featured next!

Share this post: Share this post with the world.
  • TimesURL
  • Gatorpeeps
  • Muti
  • Twitter
  • Posterous
  • Facebook
  • laaik.it

Other stuff you might like

5 Comments so far »

  1. star affiliano for Money said,

    Wrote on June 2, 2009 @ 16:23

    Sorry, it shows error while saving template..not worked….

  2. Lester Hein said,

    Wrote on June 2, 2009 @ 16:51

    Hi Star,

    I’ve just checked the process again and it seems to still be working. What is the error that you are receiving?

    Lester

  3. Margot said,

    Wrote on June 3, 2009 @ 19:20

    Hi there – I’ve been looking for exactly this type of tip, and followed your instructions to the letter (I thought) – but I get this error message below after clicking “Save Template”.

    Any idea why?

    Margot

    We were unable to save your template
    Please correct the error below, and submit your template again.
    Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly.
    XML error message: The content of elements must consist of well-formed character data or markup.

  4. Lester Hein said,

    Wrote on June 5, 2009 @ 11:11

    Okidoki, after much head scratching I finally figured out the issue.

    The code works fine, but our blog was not displaying the place holders correctly.

    Instead of

    6 things you should do on your Wordpress blog (Tuesday Tips #2) | Afrigator Blog said,

    Wrote on June 9, 2009 @ 09:02

    [...] you’re new here, you may want to subscribe to the Afrigator RSS feed. Thanks for visiting!In last week’s edition of Tuesday Tips, we covered a very cool tricks for Blogger.com and this week it’s time to have some fun with [...]

Comment RSS · TrackBack URI

Leave a Comment

Name: (Required)

E-mail: (Required)

Website:

Comment:

"));