Kode Random Post ini hanya berupa kode modifikasi saja dari postingan terdahulu tentang Random Post Blogspot, kelegihan dari kode Random Post Blogspot yang baru ini adalah loading scriptnya lebih cepat karena menggunakan teknik Jquery, silahkan di simak codingnya :
Catatan :
Bila templete blog sobat belum di pasang plugin jquery silahkan tambahkan script yg berwarna merah di bawah ini, tapi kalow udah terpasang di blog sobat silahkan dihapus kode script jquery yg berwarna merahnya.
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<!--random post start-->
<style type='text/css'>
#random-posts li{width:105px;height:150px;margin-right:12px;float:left;list-style:none;position:relative} #random-posts li:last-child{margin-right:0} #random-posts li img{width:100px;height:100px} #random-posts li img a{border:#333 solid 2px}; #random-posts li .isinyako{position:absolute;width:105px;top:-150px;z-index:2;background-color:#F0F0F0;padding:5px;font-size:90%;border-bottom:1px solid black;transition:all 0.6s cubic-bezier(1,2,0,0) 0s;-moz-transition:all 0.6s cubic-bezier(1,2,0,0) 0s;-webkit-transition:all 0.6s cubic-bezier(1,2,0,0) 0s;-o-transition:all 0.6s cubic-bezier(1,2,0,0) 0s;visibility:hidden;opacity:0} #random-posts li:last-child .isinyako{right:0} #random-posts li:hover .isinyako{top:-40px;opacity:1;visibility:visible} .isinyako span{font-size:90%;color:#B30B0B} .isinyako p{font-size:90%;}
</style>
<span class='glap'>
<ul id='random-posts'></ul>
</span>
<script type='text/javaScript'>
//<![CDATA[
var rdp_numposts = 8; //jumlah post yang akan ditampilkan
var rdp_snippet_length = 150; //banyaknnya deskripsi singkat per post
var rdp_info = '0'; // 0:berarti waktu tgl publikasi per post tidak aktif, 1:berarti aktif
var rdp_comment = 'Comments';
var rdp_disable = 'Turn off comments'; //berarti komentar tidak aktif
var rdp_current = [];
var rdp_total_posts = 0;
var rdp_current = new Array(rdp_numposts);
function totalposts(a){rdp_total_posts=a.feed.openSearch$totalResults.$t}
document.write('<script type="text/javascript" src="http://www.trikalfanetcell.com/feeds/posts/default?alt=json-in-script&max-results=0&callback=totalposts"><\/script>');
function getvalue(){for(var b=0;b<rdp_numposts;b++){var d=false;var c=get_random();
for(var a=0;a<rdp_current.length;a++){if(rdp_current[a]==c){d=true;break}}if(d){b--}else{rdp_current[b]=c}}}
function get_random(){var a=1+Math.round(Math.random()*(rdp_total_posts-1));
return a};
//]]>
</script>
<script type='text/javaScript'>
//<![CDATA[
function random_posts(n){a=location.href;y=a.indexOf("?m=0");
for(var f=0;f<rdp_numposts;f++){var l=n.feed.entry[f];
var m=l.title.$t;if("content" in l){
var o=l.content.$t}else{
if("summary" in l){
var o=l.summary.$t}else{var o=""}}o=o.replace(/<[^>]*>/g,"");
if(o.length<rdp_snippet_length){var k=o}else{o=o.substring(0,rdp_snippet_length);var b=o.lastIndexOf(" ");
k=o.substring(0,b)+"…"}for(var e=0;e<l.link.length;e++){if("thr$total" in l){var h=l.thr$total.$t+" "+rdp_comment}else{h=rdp_disable}
if(l.link[e].rel=="alternate"){var d=l.link[e].href;
if(y!=-1){d=d+"?m=0"}var g=l.published.$t;
if("media$thumbnail" in l){var c=l.media$thumbnail.url}else{c="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg67tj7PIIMHgygdPTL18T8Zt65EH45-AjnUrUoH3iDMxeODm2SSgiV993Iisq6Mn922AhdORvNk9lzM1JczgVfM6_YtO-47ShLLqPuCIi8wtSf-ncq8hKNhEF59L7lxSDkDxXrZ7FJoZ4/s1600/no_image.jpg"}
}}
$("#random-posts").append('<li><a href="'+d+'" rel="nofollow"><img alt="'+m+'" src="'+c+'" title="'+m+'"/></a><div class="isinyako"><h5>'+m.substring(0,20)+'...</h5><div style="clear:both"></div></li>');
}}
getvalue();
for(var i=0;i<rdp_numposts;i++){
document.write('<script type="text/javascript" src="http://www.trikalfanetcell.com/feeds/posts/default?alt=json-in-script&start-index='+rdp_current[i]+'&max-results=1&callback=random_posts"><\/script>')
};
//]]>
</script>
<!--random post end-->
Kode yang berwarna merah silahkan ganti sendiri misalnya : namablog.blogspot.com.
Smoga bisa berguna....
ConversionConversion EmoticonEmoticon