https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh45xvuGXo6xhG-9OWUdp05kI5DKQhg45vYMtZyw9ZHRt4WTcWtBWQ1yVtUMzDoth31_6ZJbxFkwyyZPfPbKLI_vgOMy30sO8VAOCVoQrIDjmAPG36G50_ykPB_zJxFUIGWocixX4h4Wlo/https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqU9EN-G13CSKCmhOSaO_-nvwzqZKu19B_OpnK8bI31PreyJRcrMAQxIqFO4Si6sRqyAWCThXxVK8gRTg68Fb3MpHnzXbTHilvsMziqfTJD1R1D_V-Wluh4vnHnT8VdLdczYsCY0eSe4k/s1600/twitter_64.png

Cara Menampilkan Random Post

Cara Menampilkan Random Post / Artikel Acak Di Blogger

Agar bisa menampilkan random post di blogger maka seperti biasanya langkah pertama yang harus di lakukan adalah Login ke Dashboard blogger kemudian klik Design / Rancangan / Tata Letak.
Klik Add a Gatget, kemudian pilih Gadget HTML/JavaScript.
Masukkan script random post berikut di dalam Gadget HTML/JavaScript tersebut


<script type="text/javascript">
var randarray = new Array();var l=0;var flag;
var numofpost=10;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 src="/feeds/posts/default?alt=json-in-script&start-index=1&max-results=1000&
callback=randomposts" type="text/javascript"></script>

Setelah script random post di atas sudah di masukkan jangan lupa untuk menyimpan nya.
Nah itulah Panduan Cara Membuat Random Posts Di Blogger.

0 komentar:

:10 :11 :12 :13 :14 :15 :16 :17
:18 :19 :20 :21 :22 :23 :24 :25
:26 :27 :28 :29 :30 :31 :32 :33
:34 :35 :36 :37 :38 :39

Posting Komentar

Random Posts

Posting Terbaru