Haq Hai Humara Haq Hai Hamara - Vishal Mishra | Lyrics | Mp3 Download

Title Name  - Haq Hai Humara Cast/Starring  - Shahrukh Khan Singer Name - Vishal Mishra Lyric - Manoj Muntashir Print Lyri...

Show Random Post/Content of Website or Blog | Blogger/Blogspot

Random Post - Hindi

Show a different Post / Content every time they Reload the page or open a new page, it can be called Random Post.
You can also add this feature to your website or blog and randomly show any post / content, so that your website / blog has more views and you can make maximum revenue.

How to Add Random Post Feature

>> First, you open your blogger account.
>> Now open your website / blog theme in HTML mode.
>> Then paste this CSS code before ]]></b:skin>

#random-posts-pcmain img {height: 100px; width: auto;
text-align: center; background: white; border-radius: 5px;
margin-top: 12px; 
}

#random-posts-pcmain img:hover {
   
}

ul#random-posts-pcmain { 
   background-color: white;float:center; margin-left: 2px; margin-top: 15px;
}

#random-posts-pcmain a { text-align: center; width: 100%;
min-height:100%;color: white;display:block; font-size: 13px;
margin-top: -20px; line-height: 17px; font-weight: bold;}

#random-posts-pcmain a:hover {
    text-decoration: none;
}

.random-summary {
    font-size: 11px;
    background: none;
    padding: 5px;
    margin-right: 8px; display: none;
}

#random-posts-pcmain li {height: 150px; overflow: hidden;
background-color: #a30c0c;box-shadow:0 0 4px rgba(180, 180, 180, 0.55);width: 221px;float:left;margin:5px !important;padding:2% !important; margin-bottom: 0px; border-radius: 5px; border-bottom: 10px solid #a30c0c;
}

#random-posts-pcmain li:hover{ opacity: 0.6;}

== You can make changes according to your needs.
>> Now wherever you want to show Random Post, paste the below code-

<ul id='random-posts-pcmain'>
<script type='text/javaScript'>
var randomposts_number = 4;
var randomposts_chars = 110;
var randomposts_details = 'no';
var randomposts_comments = ' ';
var randomposts_commentsd = 'Comments Disabled';
var randomposts_current = [];
var total_randomposts = 0;
var randomposts_current = new Array(randomposts_number);

function randomposts(json) {
    total_randomposts = json.feed.openSearch$totalResults.$t
}
document.write('<script type=\"text/javascript\" src=\"/feeds/posts/default?alt=json-in-script&max-results=0&callback=randomposts\"><\/script>');

function getvalue() {
    for (var i = 0; i < randomposts_number; i++) {
        var found = false;
        var rndValue = get_random();
        for (var j = 0; j < randomposts_current.length; j++) {
            if (randomposts_current[j] == rndValue) {
                found = true;
                break
            }
        };
        if (found) {
            i--
        } else {
            randomposts_current[i] = rndValue
        }
    }
};

function get_random() {
    var ranNum = 1 + Math.round(Math.random() * (total_randomposts - 1));
    return ranNum
};
</script>
<script type='text/javaScript'>
function random_posts(json) {
    for (var i = 0; i < randomposts_number; i++) {
        var entry = json.feed.entry[i];
        var randompoststitle = entry.title.$t;
        if ('content' in entry) {
            var randompostsnippet = entry.content.$t
        } else {
            if ('summary' in entry) {
                var randompostsnippet = entry.summary.$t
            } else {
                var randompostsnippet = "";
            }
        };
        randompostsnippet = randompostsnippet.replace(/<[^>]*>/g, "");
        if (randompostsnippet.length < randomposts_chars) {
            var randomposts_snippet = randompostsnippet
        } else {
            randompostsnippet = randompostsnippet.substring(0, randomposts_chars);
            var whitespace = randompostsnippet.lastIndexOf(" ");
            randomposts_snippet = randompostsnippet.substring(0, whitespace) + "&#133;";
        };
        for (var j = 0; j < entry.link.length; j++) {
            if ('thr$total' in entry) {
                var randomposts_commentsnum = entry.thr$total.$t + ' ' + randomposts_comments
            } else {
                randomposts_commentsnum = randomposts_commentsd
            }; if (entry.link[j].rel == 'alternate') {
                var randompostsurl = entry.link[j].href;
                var randomposts_date = entry.published.$t;
                if ('media$thumbnail' in entry) {
                    var randompoststhumb = entry.media$thumbnail.url
                } else {
                    randompoststhumb = "https://1.bp.blogspot.com/-41oA7makw5o/XrmzVlIIvgI/AAAAAAAAENQ/uLTbjwHdbHI9AseJE7XjnJM5g2l5lqX_QCLcBGAsYHQ/s1600/no-image-on-this-post.png"
                }
            }
        };
        document.write('<li>');
        document.write('<a href="' + randompostsurl + '" rel="nofollow"><img alt="' + randompoststitle + '" src="' + randompoststhumb + '"/></a>');
        document.write('<div><a href="' + randompostsurl + '" rel="nofollow">' + randompoststitle + '</a></div>');
        if (randomposts_details == 'yes') {
            document.write('<span><div  class="random-info">' + randomposts_date.substring(8, 10) + '.' + randomposts_date.substring(5, 7) + '.' + randomposts_date.substring(0, 4) + ' - ' + randomposts_commentsnum) + '</div></span>'
        };
        document.write('<br/><div class="random-summary">' + randomposts_snippet + '</div><div style="clear:both"></div></li>')
    }
};
getvalue();
for (var i = 0; i < randomposts_number; i++) {
    document.write('<script type=\"text/javascript\" src=\"/feeds/posts/default?alt=json-in-script&start-index=' + randomposts_current[i] + '&max-results=1&callback=random_posts\"><\/script>')
};
</script>
</ul>

>> Now you SAVE the theme.

Watch Video



No comments:

Post a comment