GfWoBUY9Tpz9TpziGfM5BSWoTY==

How to Install Recent Comment Widget on Blog


Have you ever come across a blog that installs a widget to display the latest comments on the blog?. Although it may be rare, sometimes some blogs install such widgets so that other visitors know and may also be interested in contributing to their comments on the articles that are currently being commented on.

How to Install Recent Comment Widget on Blog

As mentioned above, this widget functions to display the latest comments that appear on blog posts. Not only useful for visitors, this widget is also quite helpful for site owners. By installing this widget, we will immediately know if there are new comments that come in. In addition, we will also know the extent to which our articles get the attention (including comments) from their readers.

Well, on this happy occasion, we will learn about finding the latest comment widget or recent comments on the blog (blogspot). The method is quite easy because we will only add the author's code via the blogger layout menu. You can install this widget on the sidebar of the blog or the footer. It's up to you where to put it.

How to Create a Recent Comment Widget on Blogspot

  • Open your blogger account.
  • Select the layout menu (layout).
  • Click add gadget on the desired placement.
  • Select HTML/JavaScript, fill in the title and paste the code below into the box provided.

<script type="text/javascript">
var a_rc = 5;
var m_rc = false;
var n_rc = true;
var o_rc = 100;
function showrecentcomments(e){for(var r=0;r<a_rc;r++){var t,n=e.feed.entry[r];if(r==e.feed.entry.length)break;for(var i=0;i<n.link.length;i++)if("alternate"==n.link[i].rel){t=n.link[i].href;break}t=t.replace("#","#");var a=t.split("#");a=a[0];var c=a.split("/");c=c[5],c=c.split(".html"),c=c[0];var s=c.replace(/-/g," ");s=s.link(a);var o=n.published.$t,l=(o.substring(0,4),o.substring(5,7)),u=o.substring(8,10),m=new Array;if(m[1]="Jan",m[2]="Feb",m[3]="Mar",m[4]="Apr",m[5]="May",m[6]="Jun",m[7]="Jul",m[8]="Aug",m[9]="Sep",m[10]="Oct",m[11]="Nov",m[12]="Dec","content"in n)var d=n.content.$t;else if("summary"in n)var d=n.summary.$t;else var d="";var v=/<\S[^>]*>/g;if(d=d.replace(v,""),document.write('<div class="rcw-comments">'),1==m_rc&&document.write("On "+m[parseInt(l,10)]+" "+u+" "),document.write('<span class="author-rc"><a href="'+t+'">'+n.author[0].name.$t+"</a></span> commented"),1==n_rc&&document.write(" on "+s),0==o_rc)document.write("</div>");else if(document.write(": "),d.length<o_rc)document.write("<i>&#8220;"),document.write(d),document.write("&#8221;</i></div>");else{document.write("<i>&#8220;"),d=d.substring(0,o_rc);var w=d.lastIndexOf(" ");d=d.substring(0,w),document.write(d+"&hellip;&#8221;</i></div>"),document.write("")}}}
</script><script src=https://santossalam.blogspot.com/feeds/comments/default?alt=json-in-script&callback=showrecentcomments></script>
<style type="text/css">
.rcw-comments a {text-transform: capitalize;}
.rcw-comments {border-bottom: 1px dotted;padding: 7px 0;}
</style>

Information :

  1. To set the number of comments, in var a_rc replace the number 5 with the desired number.
  2. To display the comment date, in var m_rc change false to true.
  3. To hide the article title, in var n_rc change true to false.
  4. To determine the number of comment characters displayed, in var o_rc replace the number 100 with the number according to taste.
  5. Don't forget to replace santossalam.blogspot.com with your blog's URL.
  6. Save the widget and see the result.

Comments0


Dapatkan update informasi pilihan dan terhangat setiap hari dari Rafadhan Blog. Temukan kami di Telegram Channel, caranya klik DISINI