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 ?

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

Unknown said...

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

AC10 Tech said...

Nice post, best blog.

Artikelcara10

Anonymous 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

parisen said...

Call Girls In Rishikesh @ https://haridwarescortgirl.blogspot.in/2017/07/find-here-extremely-sizzling-call-girls.html
Escorts In Rishikesh @ http://idleexperts.com/public/Article/index/id/152609
Escort Service Rishikesh @ http://articleneed.com/make-pleasant-night-with-hottest-call-girls-in-rishikesh/
Escorts In Rishikesh @ http://www.eioba.com/a/5hh2/easy-to-get-knowledgeable-rishikesh-escorts-girls-at-haridwar
Escorts Service Rishikesh @ http://rishikeshcallgirls.kinja.com/revitalize-your-boring-life-with-erotic-rishikesh-call-1796705735
Escorts Rishikesh @ https://penzu.com/public/b1bce2f1
Rishikesh Escorts Agency @ https://uberant.com/article/286287-one-spot-for-complete-rishikesh-escorts-service-/
High Profile Escorts In Rishikesh @ http://www.makemyarticles.com/ArticleDetails/95664/Getting_impeccable_feeling_by_Rishikesh_Call_girls.html
Independent Escorts In Rishikesh @ http://rishikeshcallgirl.strikingly.com/
Independent Rishikesh Escorts @ https://www.smore.com/8vfpy-independent-escorts-in-rishikesh
Model Escorts In Rishikesh @ http://haridwarescort.over-blog.com/2017/07/things-to-recollect-while-employing-rishikesh-escorts-girl.html
Rishikesh Call Girls @ http://www.buzzsprout.com/110620
Rishikesh Escorts @ https://haridwarescort.joomla.com/8-rishikesh-escorts-girls
Rishikesh Escorts @ https://www.minds.com/blog/view/730030465733369856
Rishikesh Escorts Service @ http://aliyasharma1.deviantart.com/art/Things-to-memorize-while-utilize-Rishikesh-escorts-691200586
Rishikesh Model Escort @ http://www.sivaindia.com/ad/rishikesh-call-girls-make-your-night-colourful-250833
Celebrity Escorts In Rishikesh @ https://stackstreet.com/meet-intriguing-call-girls-rishikesh/
Vip Escorts In Rishikesh @ https://www.slideshare.net/haridwarescort/educated-call-girls-in-rishikesh-escorts-services

Tanya said...

Agra Escorts
Call Girls in Agra
Escort girls in Agra
Escorts in Agra

Unknown said...

Neemrana Esorts
Escorts in Neemrana
Call Girls in Neemrana
http://www.chiggy-wiggy.com/neemrana.html

yashraj said...


manali escort services It is very easy to for you to contact with us. We open 24/7 to make your appointment and help you all the way
for more details . We have extremely impressive escorts are available for dinner, date and party so don't be nervous about communicate with us when mood hits you.Best Escort Services in Shimla with hot body. Book Call Girls tonight in Shimla. Book Hotel and call us. Private hot girl massage in Shimla

nipelse said...

You ought to faithfully be with a charming and connecting with lady and have a recent out of the case new surprising institution with VIP Chandigarh escorts services available. You expertise your day, for a possibility, or an evening in town, you altogether chance would support to not pay simply it.

http://www.chandigarhescort.biz/

Fin said...

You have a good point here!I totally agree with what you have said!!Thanks for sharing your views...hope more people will read this article!!! Minecraft server list

Anaya said...

I admire this article for the well-researched content and excellent wording. I got so involved in this material that I couldn’t stop reading. I am impressed with your work and skill. Thank you so much. economy minecraft servers

Post a Comment

Related Posts Plugin for WordPress, Blogger...

Comments

Twitter Delicious Facebook Digg Favorites More