Nov 6, 2017

How to add feeling lucky widget to blogger

How to add feeling lucky widget to blogger

Hello, welcome to Guide Tricks today in this tutorial I am going to show you how to add “feeling lucky widget to blogger” this widget is very good to your blogger blog it helps to make your visitor activity in your blog by displaying good formation which is posted already on your blog.  

Also Read: How to Schedule Blog Posts for Auto Posting in Blogger

How the widgets works is, when a visitor clicks on the image display on your sidebar or any location that is placed in the blog “Are you feeling lucky” he will be automatically redirected to a random post in your blog without asking the user to choose which article did he want to read or asking for category. 

Also Read: How to Add/Remove Author or Move Blogger Blogs To Another Account

You can add this widget on your blog in a few seconds even you don’t have knowledge of coding. The step Is just go to your blog “layout” page and add the code given below into an “HTML/JavaScript” box and press the save button. 
<script type="text/javascript">
function showLucky(root) {
var feed = root.feed;
var entries = feed.entry || [];
var entry = feed.entry[0];
for (var j = 0; j <; ++j) {
if ([j].rel == 'alternate') {
window.location =[j].href;
function fetchLuck(luck) {
script = document.createElement('script');
script.src = '/feeds/posts/summary?start-index=' + luck + '&max-results=1&alt=json-in-script&callback=showLucky';
script.type = 'text/javascript';
function feelingLucky(root) {
var feed = root.feed;
var total = parseInt(feed.openSearch$totalResults.$t, 10);
var luckyNumber = Math.floor(Math.random() * total);
a = document.createElement('a');
a.href = '#random';
a.rel = luckyNumber;
a.onclick = function() {
a.innerHTML = 'Are you feeling lucky?';
<script src="/feeds/posts/summary?max-results=0&alt=json-in-script&callback=feelingLucky"></script>

Also Check Out: How to Add Google Custom Search Engine to Blogger Blog

Previous Post
Next Post

post written by:

Hey! I’m Muhammad Abba Gana, popularly known as AbbaGana, a blog Scientist by mind and a passionate blogger by heart fountainhead of Guidetricks, Duniyan Fasaha, Duniyar Yau, Hanyantsirah, Gidan Novels, Abba Gana Novels and Be With Me Technology, I am twenty something year old guy from Jimeta, Adamawa State, Nigeria. I’m a Freelance writer, Information marketer, professional blogger, Web designer, Internet speaker, software Developer and also an author. I make living with my laptop and can work from anywhere I find myself (as long as there is a power supply and a reliable internet connection).


We Cherish Your Comments Most, Kindly Drop your comments below. Don't forget to click "Notify Me" to know if we have responded to your comments, Thank You.