Please help - I want to have insert Recent Comments to my blog

Sandy
Sandy
from Delhi
15 years ago

Hi

I have added a recent comments widget to my blog. This widget typically displays comments of the last 1 or 2 days. However,my blog does not attracts too much traffic. So most of the time, no comments are shown. I want to change it to last 5 comments. Any suggestions. Any other suggestions regarding the layout of the blog are welcome too.

http://sandywriter.blogspot.com/

Replies 1 to 4 of 4 Descending
Rahul Anand
Rahul Anand
from Thalassery
15 years ago

You are asking how to change it to last five comments? You probably are using some html code to make it appear right?  Mostly it may contain some parameter to specify how many comments are to be shown. Just check it!

 

And.. the horizontal width of the blog go beyond the screen in my PC. I think you better make sure the main container's width is 100%, and not more!

And try different colours to the design if u like!

Happy bloggin!

Think beyond imagination!

 

Yogeshwar Kmar
Yogeshwar Kmar
from Bangalore
15 years ago

Hello Sandeep,

Even i added the same recent comments from ur widget. And recently, due to some error  there are no comments shown. It shows sometimes and sometimes there are no commenst shown..

However as regards to your question that if you want to change it to 5 comments, you simply have to change the value of 3 to 5.

<script style="text/javascript" src="http://giga.ovh.org/rc"></script><script style="text/javascript">var a_rc=3;var m_rc=true;var n_rc=true;var o_rc=100;</script><script src="http://yogeshwarkumar.blogspot.com/feeds/comments/default?alt=json-in-script&callback=showrecentcomments"></script>

 

Do ask again if your doubts are not cleared

 

 

 

Sandy
Sandy
from Delhi
15 years ago

Thanks to every one who tried to help but have solved the issue myself.  I am posting the code as well.

@Choco

Plzz tell me exactly what shud i do to increase traffic and also become more visible on search engines.

 

Here is the code. Change the numcomments to whatever u want.

 

<script style="text/javascript">function showrecentcomments(json) {  var numcomments = 3;  var showcommentdate = true;  var showposttitle = true;  var numchars = 20;for (var i = 0; i < numcomments; i++) {    var entry = json.feed.entry[i];    var alturl;    if (i == json.feed.entry.length) break;for (var k = 0; k < entry.link.length; k++) {      if (entry.link[k].rel == 'alternate') {        alturl = entry.link[k].href;        break;      }    }   alturl = alturl.replace("#", "#comment-");   var postlink = alturl.split("#");   postlink = postlink[0];   var linktext = postlink.split("/");   linktext = linktext[5];   linktext = linktext.split(".html");   linktext = linktext[0];   var posttitle = linktext.replace(/-/g," ");   posttitle = posttitle.link(postlink);   var commentdate = entry.published.$t;   var cdyear = commentdate.substring(0,4);   var cdmonth = commentdate.substring(5,7);   var cdday = commentdate.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 comment = entry.content.$t;}   else   if ("summary" in entry) {     var comment = entry.summary.$t;}   else var comment = "";var re = /<\S[^>]*>/g;   comment = comment.replace(re, "");document.write('<br/>');   if (showcommentdate == true) document.write('On ' + monthnames[parseInt(cdmonth,10)] + ' ' + cdday + ' ');document.write('<a href="' + alturl + '">' + entry.author[0].name.$t + '</a> commented');   if (showposttitle == true) document.write(' on ' + posttitle);document.write('<br/>');if (comment.length < numchars) {document.write('<i>');         document.write(comment);document.write('</i>');}   else        {document.write('<i>');         comment = comment.substring(0, numchars);         var quoteEnd = comment.lastIndexOf(" ");         comment = comment.substring(0, quoteEnd);document.write(comment + '...<a href="' + alturl + '">(more)</a>');document.write('</i>');}document.write('<br/>');  }document.write('<br/>');}</script>

Rahul Anand
from Thalassery
15 years ago

Don't miss to check out the Increase Blog Traffic topic in indiblogger forums!

Sandy
Sandy
from Delhi
15 years ago

ET, can u tell me whats ur screen resolution. Mine is 1280 by 800. In mine, the blogs appearance is perfect.


LockSign in to reply to this thread