Recent Posts Widget @ Hoctro’s Place

For those who need a recent posts widget like the one on the right for their blog (Blogger only), you can go to Hoctro’s Place to add one to your own blog.

However, this recent posts widget has its limitations. Firstly it’s limited to a maximum of 25 posts because it processes its data from the Atom feed for the blog. This Atom feed is fixed at 25 posts for Blogger and there doesn’t seem to be a way to change the maximum number of posts for the Atom feed in Blogger.

Currently, the widget determines the most recent posts by last updated date and not post date. I haven’t checked whether that is changeable in the widget code or it’s due to limitations of the Atom Feed.

Something else to note when you add the widget code to your Blogger template. You need to add the code between tags (e.g in the sidebar) and not between tags as in the post. I think Hoctro did a typo there.

Ok, the rest of this post is about why I included this widget in this blog. You can start reading other posts now :)

I use the Atom feed for this blog to Google Sitemaps to index it for Google Search. As I update the blog, users searching for content in older posts get directed by Google Search to the post’s label instead. Since I can’t upload a sitemap to this blog for Google Sitemaps, I hope this Recent Posts widget is the best way to help any lost readers coming via Google Search to find what they’re looking for. One more reason to get a custom domain for a blog :)

Tags:

Changed the max posts displayed per category

Finally figured out how to change the maximum posts shown when clicking on a particular category in the View Posts by Categories widget.

My apologies to anyone who has attempted to view posts by category and given up due to the large number of images trying to load at the same time.

For any Blogger user who wants to change it, you have to go to the Template Tab > Edit Html Page. Ensure that Expand Widget Templates is checked and search for ‘data:label.url’.

Change ‘data:label.url’ to ‘data:label.url + “?max-results=10″‘. Substitute 10 for the number of posts to be shown. Ensure the quotation marks are in the correct positions! (I messed up for quite a while due to my understanding of quotation marks in other programming languages.) Finally, save the template and you’re done!

Always remember to BACKUP your template first though.

This more detailed post at hackosphere.blogspot.com served as my reference for this template edit. Thanks Ramani!

Tags:

« Previous Page

Blog Widget by LinkWithin