Saturday, November 28, 2009

How To Add A List Of Random Posts To Your Blog

In this post i will show you how to add two types of random posts lists to your blog.This blog tip is very easy to add to your blog so you will have it up and running in a few minutes.The first widget will list the titles of some random posts from your blogs archive.The second widget will list the titles with a short summery of random posts from your archive.

The random post gadget will be another great way to display posts to your readers they might otherwise never see.This will keep visitors on your blog and hopefully turn them into return visitors and subscribers, Sounds Great lets do it !

With both you can choose the amount of posts you want listed and with the second you can choose how long you wish the summery to be.

Here's a screenshot of the first widget titles only:




Random Posts Widget


Here's a preview of the second widget titles and summery:


Random Posts Widget
Get The Random Posts List

And Here's how to add the widget to your blog :

1.Click 'Layout' For your blog

2.Click 'Add a gadget'
add a gadget blogger

3.Select 'html/javascript'



4.Paste the code below in the code area provided :
(Use a title like 'Random Posts' 'Popular Posts'...)

Widget with titles only:


<script type="text/javascript">
var randarray = new Array();var l=0;var flag;
var numofpost=5;function randomposts(json){
var total = parseInt(json.feed.openSearch$totalResults.$t,10);
for(i=0;i < numofpost;){flag=0;randarray.length=numofpost;l=Math.floor(Math.random()*total);for(j in randarray){if(l==randarray[j]){ flag=1;}}
if(flag==0&&l!=0){randarray[i++]=l;}}document.write('<ul>');
for(n in randarray){ var p=randarray[n];var entry=json.feed.entry[p-1];
for(k=0; k < entry.link.length; k++){if(entry.link[k].rel=='alternate'){var item = "<li>" + "<a href=" + entry.link[k].href + ">" + entry.title.$t + "</a> </li>";
document.write(item);}}
}document.write('</ul>');}
</script>
<script src="/feeds/posts/default?alt=json-in-script&start-index=1&max-results=1000&callback=randomposts" type="text/javascript"></script>


Change this piece of code to set how many posts are displayed:

var numofpost=5


Widget with titles and summery :


<script type="text/javascript">
var randarray = new Array();var l=0;var flag;
var numofpost=5;var wordnumber=9;</script>
<script style="text/javascript" src="http://bloggertipspro.googlepages.com/random-posts-with-summary.js">
</script>
<script src="/feeds/posts/default?alt=json-in-script&start-index=1&max-results=1000&callback=randomposts" type="text/javascript"></script>


We Are Nearly Finished - First A Quick Reminder:
If you need more help or have an opinion or suggestion Please leave a comment Below.It also really helps me to get feedback.
This is a Do-Follow Blog so leaving a comment will also help Your blogs Google rank.
OK Back to business....

Change this piece of code to set how many posts are displayed:

var numofpost=5

Change this piece of code to set how many words ore displayed in the summery are displayed:

var wordnumber=9
Once your happy with the settings click save.

You have just added a cool new way for people to navigate your blog, make sure to check out some more great blog gadgets you will love !

Have you gone random ?


Did You Like This Post ? Click Like Below To Let Us And Your Friends Know - Thanks !





Jump To Comments

Subscribe To The Rss Feed Or Recieve The Latest Posts By Email

Get The Latest Full Posts By Email - It's Free
Write About Or Link To This Post On Your Blog - Easy Links :
Link Directly To This Post :

Link To The Homepage :
Hey ! People That Read This Post Also Loved These Posts
Still Looking For Something ?
Search This Blog
Custom Search
Important Must Read Before Posting A Comment

In order to keep our comments Do-Follow we have some guidelines you need to follow.
Do not put links in the body of your comment as it will automatically be blocked !
Asking a question ? Make sure to tick the subscribe to comments by email box to be alerted of the reply.
blog comments powered by Disqus
 

Some Money Makers For Your Blog

1. Info Barrel Paid To Write, if you can write a blog you can write for I.B.

1. Xomba Paid To Write, Another great paid to write articles website

3. Chitika Ads For Your Blog, work well alongside AdSense

Thanks For Calling

free counters

Five From The Archive

Who Writes This Stuff ?

Hi Im Paul Crowe,

The Author Of Spice Up Your Blog To Get More Info About Me View My Full About Me Page.

Drop Down Archive

Admin Links