Cara membuat Artikel Terkait di Sidebar

Seperti postingan saya sebelumnya yaitu Cara membuat Artikel Terkait di bawah postingan dan Cara membuat Artikel Terkait berisi Thumbnails, maka sekarang saya akan mencoba berbagi lagi :r dengan kawan cara membuat Artikel terkait yang keberadaannya di sidebar Blog.
OK langsung saja cara pembuatannya sebagai berikut :
  • Masuk ke account Blogger dengan ID kawan
  • Pada Dasbor - Rancangan pilih Edit HTML
  • Simpan template kawan dulu untuk jaga-jaga
  • Beri tanda centang disamping Expand Template Widget
  • Copas (copy-paste) kode berikut dibawah ]]></b:skin> atau diatas kode </head>
<script type="text/javascript">
//<![CDATA[
var relatedTitles = new Array();
var relatedTitlesNum = 0;
var relatedUrls = new Array();
function related_results_labels(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 removeRelatedDuplicates() {
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 printRelatedLabels() {
var r = Math.floor((relatedTitles.length - 1) * Math.random());
var i = 0;
document.write('<ul>');
while (i < relatedTitles.length && i < 10) {
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>


while (i < relatedTitles.length && i < 10) { menunjukkan jumlah Artikel Terkait yang ditampilkan
Kemudian scroll kebawah dan cari Kode seperti berikut :

<b:if cond='data:post.labels'> <data:postLabelsLabel/>
<b:loop values='data:post.labels' var='label'>
<a expr:href='data:label.url' rel='tag'><data:label.name/></a><b:if cond='data:label.isLast != &quot;true&quot;'>,</b:if>
</b:loop>
</b:if>

Hapus / ganti kode tersebut dengan kode dibawah :
    <b:if cond='data:post.labels'><data:postLabelsLabel/>
    <b:loop values='data:post.labels' var='label'>
    <a expr:href='data:label.url' rel='tag'><data:label.name/></a><b:if cond='data:label.isLast != &quot;true&quot;'>,</b:if>
    <b:if cond='data:blog.pageType == &quot;item&quot;'>
    <script expr:src='&quot;/feeds/posts/default/-/&quot; + data:label.name + &quot;?alt=json-in-script&amp;callback=related_results_labels&amp;
    max-results=10&quot;' type='text/javascript'/>
    </b:if>
    </b:loop>
    </b:if>
    <b:if cond='data:blog.pageType == "item"'>
    <h4>Artikel Terkait</h4>
    <script type="text/javascript">
    removeRelatedDuplicates();
    printRelatedLabels();
    </script>
    </b:if>

    Catatan :
    1. Artikel Terkait adalah judulnya
    2. Silahkan ganti sesuai dengan selera kawan
    3. Save / simpan template kawan
    Cara Pemasangan di Sidebar :
    1. Pada Dasbor atau tata letak Klik tambah Gadget
    2. Klik tanda tambah (+) pada HTML/JavaScript
    3. Copas (copy-paste) kode berikut kedalamnya
    <script type="text/javascript">
    removeRelatedDuplicates();
    printRelatedLabels();
    </script>
    • Simpan Template

      Description: Cara membuat Artikel Terkait di Sidebar - Rating: 4.5

      Reviewer: Putu BlogBego - Itemreviewed: Cara membuat Artikel Terkait di Sidebar


      Kawan sedang berada pada Artikel
      » Cara membuat Artikel Terkait di Sidebar
      di Blog ini dibolehkan COPY-PASTE untuk disebar-luaskan
      asal kawan menyertakan Link / Sumber Artikelnya

      Artikel Menarik Lainnya :


      Comments
      12 Comments

      12 komentar pada : “Cara membuat Artikel Terkait di Sidebar”


      1. @Zh!nTho apanya yang keren, saya kalah jauh dengan kawan apalagi otak sudah tumpul dan pelupa :z

        ReplyDelete
      2. mau aku pake nih thanks share nya

        ReplyDelete
      3. Thanks for finally talking about > "Cara membuat Artikel Terkait di Sidebar" < Liked it!

        Also visit my blog: Montaż klimatyzacji

        ReplyDelete
      4. I'm not sure where you are getting your information, but great topic. I needs to spend some time learning more or understanding more. Thanks for wonderful information I was looking for this information for my mission.

        Here is my site ... klimatyzacja

        ReplyDelete
      5. Very good article! We are linking to this great content on our site.

        Keep up the good writing.

        Check out my weblog: klimatyzacja

        ReplyDelete
      6. After I originally commented I seem to have clicked the
        -Notify me when new comments are added- checkbox
        and from now on whenever a comment is added I get 4 emails
        with the exact same comment. Perhaps there is a way you can remove me from that service?
        Appreciate it!

        Here is my page :: klimatyzacja

        ReplyDelete
      7. Fantastic items from you, man. I've be mindful your stuff prior to and you're just too excellent.
        I actually like what you have obtained right here, really like what you're stating and the way wherein you are saying it. You're making it enjoyable
        and you continue to care for to stay it wise. I can not wait to learn far more from you.
        This is actually a terrific web site.

        Take a look at my blog post klimatyzacja

        ReplyDelete
      8. I do not create a great deal of comments, but i did a few searching and wound up here
        "Cara membuat Artikel Terkait di Sidebar". And I do have 2 questions for you if you do not mind.
        Is it simply me or does it give the impression like some of the comments look
        like they are left by brain dead individuals? :-P And, if you are writing
        on additional social sites, I'd like to follow everything new you have to post. Would you make a list of every one of your shared pages like your twitter feed, Facebook page or linkedin profile?

        Check out my website: klimatyzacja

        ReplyDelete
      9. Superb, what a web site it is! This webpage presents valuable data to us, keep it
        up.

        Here is my web-site: klimatyzacja

        ReplyDelete
      10. Thanks for sharing your thoughts about klimatyzacja.
        Regards

        ReplyDelete
      KOMENTAR MENCERMINKAN KEPRIBADIAN KAWAN BLOGGER
      EKSPRESIKAN KOMENTAR DENGAN EMOTICON :

      :a :b :c :d :e :f :g :h :i :j :k :l :m
      :n :o :p :q :r :s :t :u :v :w :x :y :z