Welcome to MySide

Cara Membuat Posting dan Komentar Terbaru di Blogspot

Cara Membuat Posting Terbaru dan Komentar Terbaru di Blogspot
Cara menampilkan, memunculkan, atau membuat Posting Terbaru dan Komentar Terbaru di Blog Blogspot

GADGET "Posting Terbaru", "Recent Posts", "Latest Posts", atau "Artikel Terbaru" dan "Komentar Terbaru" (Recent Comments) di Blogspot bermasalah, bahkan tidak ada lagi.

Padahal, daftar posting terbaru dan komentar terbaru merupakan hal penting bagi blog, yaitu berfungsi sebagai link internal dan navigasi blog, yang memudahkan pengunjung menjelajahi konten blog kita.

Bagaimana jika ingin menampilkan "Posting Terbaru" dan "Komentar Terbaru" di Blogspot di sidebar atau di footer?

Cara Membuat "Recent Posts"

Berikut ini cara Membuat "Recent Posts" dan "Recent Comments" di Blogspot, yaitu dengan menggunakan Gadget "Feeds". Caranya:

Siapkan dulu "Feeds"-nya, yaitu Feed Komentar dan Feed Posts:
1. URL Blog Comments Feed.
    http://URL blog Anda/feeds/comments/default
    misalnya http://contohblognih.blogspot.com/feeds/comments/default

2. URL Blog Posts Feed.
    http://URL blog Anda/feeds/posts/default
    misalnya http://contohblognih.blogspot.com/feeds/posts/default

Berikut ini langkah mudah dan cepat membuat "Recent Posts" dan "Recent Comments" di Blogspot
1. Klik "Layout" atau "Tata Letak".
2. Klik "Add a gadget" di salah satu sidebar atau footer.
3. Pilih "Feeds"
4. Masukkan kode http://URL blog Anda/feeds/comments/default
5. Ganti nama Gadget dengan "Komentar Terbaru"
6. Save!

Untuk membuat "Recent Post" begitu juga langkahnya, cuma kode URL Feeds-nya pake yang http://URL blog Anda/feeds/posts/default dan namanya ganti jadi "Posting Terbaru".

CARA LAIN-1
Cara lain menambah atau membuat Recent Post dengan gambar thumbnail ada di SINI.

Kalau "Recent Posts" blog ini menggunakan kode berikut ini di Gadget HTML/Javascript:

<div id="hlrpsb">
<script style="text/javascript" src="http://helplogger.googlecode.com/svn/trunk/recent-posts-with-titles-only.js"></script>
<script style="text/javascript">var numposts = 5;var showpostdate = false;var showpostsummary = false;var numchars = 100;var standardstyling = true;</script>
<script src="http://contohblognih.blogspot.com/feeds/posts/default?orderby=published&alt=json-in-script&callback=showrecentposts"></script></div>
<noscript>Oops! Make sure JavaScript is enabled in your browser.</noscript>
<style type=text/css>
#rpdr {background: url( https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcNyQ3RlA1en0pfwMshuAjb9bDsv8ybp2m6t1E6dargRxMKB004MFRdAGb2cSRAOJNREgPpMvow7TF2L3ziZ4V7Bu-feBCPSKLYVFRg-SQHeRADsD3jCULXZ-s4tccXyVqmef8a3HxP_BD/s1600/blogger.png ) 0px 0px no-repeat; padding: 1px 0px 0px 19px; height:14px; margin: 5px 0px 0px 0px;line-height:14px;}
#rpdr, #rpdr a {color:#808080;}
#hlrpsb { }
.bbrecpost2 {
padding-top:6px;
padding-bottom:6px;
border-bottom: 1px #cccccc dotted; }
</style>

Kalau mau pake, tinggal ganti contohblognih.blogspot.com dengan URL blog Anda.

CARA LAIN-1
Alternatif kode HTML/Javascript untuk memasang "Posting Terbaru" di blogspot:

<script type="text/javascript">
function showrecentposts(json) {
  for (var i = 0; i < numposts; i++) {
    var entry = json.feed.entry[i];
    var posttitle = entry.title.$t;
    var posturl;
    if (i == json.feed.entry.length) break;
    for (var k = 0; k < entry.link.length; k++) {
      if (entry.link[k].rel == 'alternate') {
        posturl = entry.link[k].href;
        break;
      }
    }
    posttitle = posttitle.link(posturl);
    var readmorelink = "(more)";
    readmorelink = readmorelink.link(posturl);
    var postdate = entry.published.$t;
    var cdyear = postdate.substring(0,4);
    var cdmonth = postdate.substring(5,7);
    var cdday = postdate.substring(8,10);
    var monthnames = new Array();
    monthnames[1] = "Jan";
    monthnames[2] = "Feb";
    monthnames[3] = "Mar";
    monthnames[4] = "Apr";
    monthnames[5] = "May";
    monthnames[6] = "Jun";
    monthnames[7] = "Jul";
    monthnames[8] = "Aug";
    monthnames[9] = "Sep";
    monthnames[10] = "Oct";
    monthnames[11] = "Nov";
    monthnames[12] = "Dec";
    if ("content" in entry) {
      var postcontent = entry.content.$t;}
    else
    if ("summary" in entry) {
      var postcontent = entry.summary.$t;}
    else var postcontent = "";
    var re = /<\S[^>]*>/g;
    postcontent = postcontent.replace(re, "");
    if (!standardstyling) document.write('<div class="bbrecpost">');
    if (standardstyling) document.write('<li>');
    document.write(posttitle);
    if (showpostdate == true) document.write(' - ' + monthnames[parseInt(cdmonth,10)] + ' ' + cdday + ', ' + cdyear);
    if (!standardstyling) document.write('</div><div class="bbrecpostsum"">');
    if (showpostsummary == true) {
      if (standardstyling) document.write('<br/>');
      if (postcontent.length < numchars) {
         if (standardstyling) document.write('<i>');
         document.write(postcontent);
         if (standardstyling) document.write('</i>');}
      else {
         if (standardstyling) document.write('<i>');
         postcontent = postcontent.substring(0, numchars);
         var quoteEnd = postcontent.lastIndexOf(" ");
         postcontent = postcontent.substring(0,quoteEnd);
         document.write(postcontent + '...' + readmorelink);
         if (standardstyling) document.write('</i>');}
}
    if (!standardstyling) document.write('</div>');
    if (standardstyling) document.write('<br/>');
}
if (!standardstyling) document.write('<div class="bbwidgetfooter">');
if (standardstyling) document.write('</li>');
document.write('');
if (!standardstyling) document.write('</div>');
}
var numposts = 10;
var showpostdate = false;
var showpostsummary = false;
var numchars = 0;
var standardstyling = false;
</script>
<script src="/feeds/posts/default?orderby=published&alt=json-in-script&callback=showrecentposts"></script>

Good Luck!

Subscribe to receive free email updates: