August 13, 2006
Related posts from your blog
Few people had expressed interest in finding related posts from their blog automatically. If you have lot of posts in archives, it is indeed difficult to find the ones that are related to the current post.
By tweaking my previous hack to display related posts from Blogosphere, I have come up with another version to do this. This time, I have tweaked it to bring out only the relevant posts or None. I use the "Search in title" operation in Google blogsearch to find the earlier posts with titles that have atleast 2 non-trivial words from the current post's title. I hope this will encourage more people to try this hack.
For plugging-in this feature to your blog, add the following piece of code after the <$BlogItemBody$> tag.
<ItemPage>
<script language="Javascript"
src="http://www.anniyalogam.com/scripts/relatedposts-blog.php?
url=<$BlogItemPermalinkUrl$>&blog=<$BlogURL$>">
</script>
</ItemPage>
This will display the related posts right after the Post body as you see below (only in post pages). Please note that it won't display anything if there are no related posts. You could also place in any other location in your template that you like to.





No comments yet