How to Add Random Post widget


Most of the bloggers add more sidebar widgets to increase pageviews. You can find Recent Post, Popular Post and Related Post widgets in almost all blogs. Now lets see displaying Random Post widget in blogger sidebar. Its a very useful widget because it lets you to show all older posts randomly fashion.  

Abdul-Hakeem.com is powered by Blogger. I use many widgets to improve page impression. The number of posts links in Random post widget to be displayed can be controlled by the webmaster. Now getting back to our topic,

Steps to Show Random Posts in Blogger:

1. Login to Blogger Account.
2. Go to Design –>Add a Gadget, and select it as “HTML/JavaScript” widget.
3. Now Copy and Paste this code in to it:


<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 type='text/javascript' src='/feeds/posts/default?alt=json-in-script&start-index=1&max-results=1000&callback=randomposts'></script>
<span style='font-size: 80%'>Widget by <a href='http://www.bloggerehow.blogspot.com'>Blogger eHow </a></span>


Note:
If you which to change number of post displayed.Change the no 5 marked as red in this code numofpost=5

Credits:
This widget script was developed by Field of Dreams

Enjoy!


14 comments:

Luc Fayard said...

Could you add a possibility to have random posts only from a label ?

Snort Port said...

Great!

GuildWars2Items said...

At twenty years of age, the will reigns; at thirty, the wit; and at forty, the judgment Cheap Minecraft Gift Code, what gets us into trouble is not what we don't know.It's what we know for sure that just ain't so Buy Xbox Live Points, life is like a hot bath. It feels good while you're in it, but the longer you stay in, the more wrinkled you get Ultimate Game Card.

The consequences of today are determined by the actions of the past scarlet blade gold. To change your future, alter your decisions today scarlet blade gold, Experience is a hard teacher because she gives the test first, the lesson afterwards scarlet blade gold, but it takes character to keep you there.

anjella martin said...

Check to see if your desired username or vanity url is still available at dozens of popular social networking and Social Bookarking websites.

Hai Huynh said...
This comment has been removed by the author.
Hai Huynh said...

Great Widget

Random post by Label

http://bloggertipsall.blogspot.com/2013/06/top-new-posts-by-category-by-label.html

Muhammad Arifuddin said...

this is awesome widget, and i use in my blogger. thanks
Armadhita Arief

Companion Escorts said...

Bangalore Escorts |
Independent Escorts Bangalore | Call Girls Bangalore |
High Profile Escorts |
Celebrity Escorts Bangalore
http://www.haveme.in

Arrhy Oktofani said...

Nice post, best blog.

Artikelcara10

Bangalore Escorts said...

Surat Escorts Sunita Verma is offering Physical Escort Service in Surat, High Class Independent Escort Girl in Surat hires me for high-class fun and relation.
http://www.geocities.ws/suratescorts/

Rubika Mathur said...

I am Rubika Mathur and i am a hot mumbai escorts girl from mumbai and a young. beautiful and sexy mumbai escorts girl. I am aeducated girl just passed out from mumbai university. I am a high class and presentable lady and you can hire me for each and every event. I am Available anytime in mumbai for outcall escorts service in mumbai

Mumbai Escorts

Mumbai independnet Escorts

Mumbai Female Escorts

independent Mumbai Escorts

Mumbai Escorts Service

Mumbai Independent Escorts Service

nadiya khan said...

escorts service in pune
pune escorts service
escorts in pune
pune escorts

pune escorts
escorts in pune
escorts service in pune
pune escorts service

pune escorts
escorts in pune
escorts service in pune
pune escorts service


pune escorts service
escorts in pune
pune escorts
escorts service in pune

amigagirl said...

This is very good site for escort service .
http://www.amiga.in/

Mona Malik said...


Best Escorts Services Provider Vadodara, Surat, Ahmedabad

Surat Escorts
Vadodara Escorts
Escorts in Ahmedabad

Post a Comment

Related Posts Plugin for WordPress, Blogger...

Comments

Twitter Delicious Facebook Digg Favorites More