Friday, March 25, 2011

Blogger: Random Posts Widget

All bloggers suffer from a common problem, How do I get new readers to visit the old posts they may find useful? New content is easily accessed since blogs are built to present things in chronological order. You work hard on a new post and it's only logical followers should know about that first. As time goes by this hard work gradually slips deep into the recesses of the Archive or Label search pages. It can be challenging for new visitors to find those interesting gems of the past without help.

The Random Posts Widget is designed to expose readers to content they might otherwise never come across. Instead of searching Google or digging through the archive visitors discover new things through serendipity. This adds value for users and generates more page views for a blog. It's important to organize the blog well, but Random Posts are an excellent way to help readers explore a blogs content.

Add Random Posts to your Blog
The Random Posts Widget is easy to install, but requires some basic script configuration to function efficiently for users. Start by clicking the button below, then click on Edit Content to view a screen like this:

Configuration Options
You must set FIRST_YEAR, FIRST_MONTH and FIRST_DAY to match the blogs first post. This is required to limit the amount of information the script deals with. Otherwise, as a blog matures some posts may slip through the cracks never to be seen again and visitors could experience performance problems. In the example above January 1, 2011 is the date of the first posting. The three additional options are set to default values, see the comments on each for further information.

Advanced Options: Styles
My Random Posts widget defaults to styles appropriate for the design of this blog at the time of posting. In order to make the look and feel your own, you should consider some customization. A little further down in the code pictured above you'll find these styles, alter them to find a look that works for your blog:
.random-template{ font-size: 11px; padding: 5px;} - Style for each random post
.random-template:hover { background-color: #ffffff;} - Background when a visitor hovers over a post
.random-template h4{ font-weight: normal; color: #ffffff; font-size: 11px; background-color: #555555;  padding: 0px 5px;} - Style of the Date line
.random-post-thumb img { max-height: 50px; max-width: 50px;} - Limits the size of Thumbnails
Summary
Random Posts are a great way of exposing visitors to long forgotten posts. Each page view brings a chance to discover new and interesting things. I recommend using this as one of many tools to add value for readers and improve the longevity of your posts. Please give the widget a try and contact me either here through comments or @JSBlogStop on twitter with any questions or comments.
6 Comments
Comments

6 comments :

Kex said...

Thanks! I'm using the widget here:

Morning Strikes Now!

One note -- since I switched the variable RANDOM_FORMAT from THUMB to SUMMARY, I had to change this line to get the MAX_LENGTH variable to be used:

From:

if(RANDOM_FORMAT == SUMMARY) {
$(idPost + " .random-post-body").html(Entry.summary.$t + "...");


To:

if(RANDOM_FORMAT == SUMMARY) {
$(idPost + " .random-post-body").html(Entry.summary.$t.substr(0,MAX_LENGTH) + "...");

Unknown said...

It's been a while since I wrote this, but if I remember correctly I intentionally set it up that way. Basically, I made the decision to use the full summary text as it was given, since it's a snippet only anyway, rather than apply the length limitation. Sort of a personal preference I probably should have mentioned.

HD Cafe said...

Cool widget, thanks for sharing it.

HD Cafe

Μανώλης Τσαγκαράκης said...

Cool widget!!! I used it in my movie blog and I like it!!!

www.tainia.info

محمد وارث said...

Really nice, cool and great widget. i searched the web for the whole day for my requirements, tried many and removed all but it met my all requirements, hats off to you sir!

Waris

Nothing said...

Good One.. thanks.. My search ends here.

Post a Comment