HashFlare

Sunday, 28 May 2017

Random post in blogger without thumbail

HashFlare HashFlare

To have random post either in your sidebar or in footer , helps to make your reader to read more and go deep in your site, The main aim is to show the readers what all other posts you have in your blog


  • For displaying it on your sidebar and in your dash board lick layout and then add a gadget and copy the code below and  save it



<!-- Random Post Start -->
<style>
#ramdomcat{float:left;  margin-top:0px;  margin-bottom:10px}
#ramdomcat ul{float:left;  margin:0px;  margin-left:20px;  padding:0px;  font-size:14px}
#ramdomcat li{list-style:disc outside url("http://2.bp.blogspot.com/-NcWoSJbuheg/Utjpc3PoLSI/AAAAAAAAAlA/Bp1xTt7G0UM/s1600/kotak2.png"); width:auto; margin-bottom:0;margin-top:0;padding:0;vertical-align:middle;}
#ramdomcat a{font-family: 'open sans',arial,sans-serif;text-decoration:none;  color:#0F0F0F; font-size:14px}
#ramdomcat a:visited {color:blue; text-decoration: none}
#ramdomcat a:hover{color:red}
</style>

<script type='text/javascript'>
var relatedpoststitle="";
</script>
<script type='text/javascript'>
var relatedTitles = new Array();
var relatedTitlesNum = 0;
var relatedUrls = new Array();
function random_results_label(json) {
for (var i = 0; i < json.feed.entry.length; i++) {
var entry = json.feed.entry[i];
relatedTitles[relatedTitlesNum] = entry.title.$t;
for (var k = 0; k < entry.link.length; k++) {
if (entry.link[k].rel == 'alternate') {
relatedUrls[relatedTitlesNum] = entry.link[k].href;
relatedTitlesNum++;
break;
}
}
}
}
function removeRandomDuplicate() {
var tmp = new Array(0);
var tmp2 = new Array(0);
for(var i = 0; i < relatedUrls.length; i++) {
if(!contains(tmp, relatedUrls[i])) {
tmp.length += 1;
tmp[tmp.length - 1] = relatedUrls[i];
tmp2.length += 1;
tmp2[tmp2.length - 1] = relatedTitles[i];
}
}
relatedTitles = tmp2;
relatedUrls = tmp;

}
function contains(a, e) {
for(var j = 0; j < a.length; j++) if (a[j]==e) return true;
return false;
}
function showRandomLabels() {
for(var i = 0; i < relatedUrls.length; i++)
{
if(relatedUrls[i]==currentposturl)
{
relatedUrls.splice(i,1)
relatedTitles.splice(i,1)

}
}
var r = Math.floor((relatedTitles.length - 1) * Math.random());
var i = 0;

if(relatedTitles.length>1)
document.write('<ul>');
while (i < relatedTitles.length && i < 20 && i<maxresults) {
document.write('<li><a href="' + relatedUrls[r] + '">' + relatedTitles[r] + '</a></li>');
if (r < relatedTitles.length - 1) {
r++;
} else {
r = 0;
}
i++;
}
document.write('</ul>');
}
</script>
<div id="ramdomcat">
<script type="text/javascript" src="/feeds/posts/default?alt=json-in-script&amp;callback=random_results_label&amp;max-results=10"></script>
<script type="text/javascript">
var currentposturl="";
var maxresults=10;
removeRandomDuplicate(); showRandomLabels();
</script>
</div>
<!-- Random Post End -->


To show posts related to label then change this code to this

src="/feeds/posts/default?alt=json-in-script

change to

src="/feeds/posts/default/-/yourLabel?alt=json-in-script

example: src="/feeds/posts/default/-/Blogger%20Guides?alt=json-in-script



to increase the number of post then change it to this

var maxresults=10;

change to

var maxresults=5; //type your value here



HashFlare

Author:

The Owner of this Site Hacker Prime, (Azeem Prime)



Use this code Link( Hacked) Only one Amazon Cart Check OUT For 36%-41% CUT in Price => Only From Amazon in INDIA
Bluehost Wordpress Hosting
Super optimized Wordpress Hosting starting at Rs.139/month (click here for the Code
=WEBSITE HOSTING !!=
============================
That's all. You are done!
If you encounter any problem, feel free and comment below to get solution. Share your experience with us.
============================


NOTE:- Do not Copy these Text and code for your commercial use. This Site is protected via DMCA.

Watch This Online

HashFlare

Post a Comment

Whatsapp Button works on Mobile Device only

Start typing and press Enter to search