Just simply edit the “http://YourBlogNameHere.blogspot.com” on the code with your own blog url. and done
If you want to learn about this widget, then please read this article more
Recent Comments on Blogger
This hack probably is one of the oldest blogger hacks ever.
So easy, Just do this steps;
1. Go to your Dashboard
2. Go to Template Tab
3. There you will see a widget manager. Click Add a Page Elements on the section you want to place the recent comment.
4. Now you should see a list of widget elements you can pick. click on the Add to Blog Button under HTML/Javascript. this element is useful if we want to add a 3rd party functionality or other code. so we pick this. remember to choose this elements each time you need to add third-party codes.
5. Now you should have a new popup window open,
- Leave the title blank
- And go to the content area.
- Copy this Code and paste on that widget content area.
please note: you should change the “http://YourBlogNameHere.blogspot.com” on the code with your own blog url.
<script src="http://files.lifewg.googlepages.com/blogger-widget.js"></script> <script> var numposts = 10; var showpostdate = false; var showpostsummary = false; var numchars = 100; </script> <h2>RECENT COMMENTS</h2> <script src="http://YourBlogNameHere.blogspot.com/feeds/comments/default?orderby=published&alt=json-in-script&callback=rp"></script>
6. Click Save Changes
7. Refresh your blog and done.
Hey Jack, I can do that, but i’m to lazy to do all that, can’t just give me any simpler way?
Oh yes of course. for you lazy boy, you can click on the button below, and just follow the instruction. yeah.. it’s easier for you lazy boy
But still, you need to edit the “http://YourBlogNameHere.blogspot.com” on the code with your own blog url.
Recent Posts on Blogger
Jack, I see that you have a Recent Post. Can I have that too for my blogspot / blogger blog?
Yes Sir, You can!
If you are not too lazy. you can follow the steps above, just focus on the last line. we need to make some changing there.
There you’ll see that the script source is like this:
src="http://YourBlogNameHere.blogspot.com/feeds/comments/default?orderby=published&alt=json-in-script&callback=rp"
see the word comment with green color there?
Comments means it will gives you list of comments. change it with posts if you want to have a list of your recent posts.
It should become like this:
src="http://YourBlogNameHere.blogspot.com/feeds/posts/default?orderby=published&alt=json-in-script&callback=rp"
Oh and also don’t forget about the title, see <h2>RECENT COMMENTS</h2> there? You know what to do
Jack, I’m too lazy to…
ok.. ok.. here it is
And still, you need to edit the “http://YourBlogNameHere.blogspot.com” on the code with your own blog url.
Jack, I don’t like the result. it’s shown as a list. How can i modify it?
Oh.. I see that you are not that lazy ![]()
Ok, please just follow this steps carefully
1. Click this file. yes i mean this. The link will let you download the javascript file resource.
2. You would probably seen your browsers is asking you whether to open or to save the file. Choose to save it as wherever you want.
3. Open it with Notepad or your favorite editor. I use Textpad
4. The source would be like this;
//credit to hoctro
function rp(json) {
document.write('<ul>');for (var i = 0; i < numposts; i++) {
document.write('<li>');
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, "");
document.write(posttitle);
if (showpostdate == true) document.write(' - ' + monthnames[parseInt(cdmonth,10)] + ' ' + cdday);
if (showpostsummary == true) {
if (postcontent.length < numchars) {
document.write(postcontent);
} else {
postcontent = postcontent.substring(0, numchars);
var quoteEnd = postcontent.lastIndexOf(" ");
postcontent = postcontent.substring(0,quoteEnd);
document.write(postcontent + '...' + readmorelink);
}
}
document.write('</li>');
}
document.write('</ul>');
}
There are some parameters you can use, they are:
var numposts = 10; /* How many posts do you want?
var showpostdate = false; /* DO you want us to show the date?
var showpostsummary = false; /* Do you want to show the post summary?
var numchars = 100; /* If you want to show the post summary, how many characters do you want to show?
5. There you’ll see that i have this lines inside
document.write('<ul>');document.write('<li>');
document.write('</li>');
document.write('</ul>');
Basically, the structure of the file is like this
function rp(json) {
HERE YOU CAN ADD ANYTHING YOU WANT, AS AN EXAMPLE IS TITLE
document.write('<ul>'); //This 2 line should keep together, without any text or whate-
(loop function start)
document.write('<li>'); // ver inside it. so don't put anything here.
------------------------------------------------------------------
HERE IS THE CONTENT.
YOUR CONTENT WOULD BE REPEATED HERE.
------------------------------------------------------------------
document.write('</li>'); //This 2 line should keep together, without any text or whate-
(loop function stop)
document.write('</ul>'); // ver inside it. so don't put anything here.
6. Here you can modify the result.
if you don’t like it’s shown on a list, you can delete all 4 lines. so it becomes like this
function rp(json) {
HERE YOU CAN ADD ANYTHING YOU WANT, AS AN EXAMPLE IS TITLE
document.write('<ul>'); //This 2 line should keep together, without any text or whate-
(loop function start)
document.write('<li>'); // ver inside it. so don't put anything here.
------------------------------------------------------------------
HERE IS THE CONTENT.
YOUR CONTENT WOULD BE REPEATED HERE.
------------------------------------------------------------------
document.write('</li>'); //This 2 line should keep together, without any text or whate- HERE YOU CAN ADD ANYTHING TO SEPARATE BETWEEN CONTENT RESULTS LINES. example <br/>
(loop function stop)
document.write('</ul>'); // ver inside it. so don't put anything here.
Just remember to always backup your original widget first if you want to do any changing or modifying on them.
Wish you luck and Have a nice try.



cool
may i know where to put this code, in the page element or in the html of the template
You can just put the code inside your html widget Keshav. but you can also just click the button to add widget above.
thanks
your hacks did not work in my blog.i’ve tried so many times both recent posts and comments.what could be the problem
oh now i can use recent post hack. still i want recent comments hack and i see only on your post title..
thank you jack
[...] the right is a Feed Widget Element. You can change it with your own feed url, or you can have the recent post and recent comment for blogger simple hack [...]
your recent comments hack did not work properly, it shows only the button.though recent posts works fine
[...] the right is a Feed Widget Element. You can change it with your own feed url, or you can have the recent post and recent comment for blogger simple hack [...]
[...] I have written the tips and the widgets there about Recent Comments and Recent Posts on Blogger. but I think I need to still write this tip, so we can learn that there are many alternative ways [...]
Hi Jack,
Your blog inspires me. Can you tell us how to do the below hacks in blogspot blog.
1. “Popular ” or most popular/viewed posts on left side bar
2. post date in an icon , right side of every post
thanks
Hi Siddu,
1. about the popular post, i guess you can’t have it automatically, since we can’t store any data into blogger.
so all you need to do is just pick up manually by your self all popular post, and list them.
then you can put the list anywhere.
2. about post date in an icon, you can see my templates collection to see the example. here is one of them.
You don’t really need or want that lifestyle, it might hurt y’all slowly more…….Just tell him you
don’t wanna repeat something your not too proud of z7uas.
i’m sorry. who’re you replying to?
Hi Jack… I’m very grateful to your information… it’s very useful
… I’m adding this to my blog … once again, thanks 
[...] can see how to get a recent comment list and recent post list on blogger there. [...]
Thank you very much for sharing the tips and tricks. It is very useful
Thanks Alot for this Help I tell you that your ttorial has been of great help to me, God bless you.
I have not been able to do the top commentators, and related posts widgets.
id like you to help where you can
Thanks
look at my sidebar, there you can find some list of cool blogger hacks.
here is your related posts on blogger. thanks
58964
58964
i
i
Thanks. It’s great to find the code for recent posts here and it works.
Thanks for this.
I’ve added Recent Comments to my blog but is it possible to show the poster’s name and the post title?
Because all it shows is the comment. Plain comment. It doesn’t indicate which post the comment was meant for or who the poster is.
[...] 3. On that demo site sidebar , I use this blogger recent post tricks. But you can try this other trick to get blogger recent posts and tricks. [...]
Thank you for your information
Jack,
Happy New Year!
I am now using your Fresh Blogger Template. It is very nice, thanks!
But when I add this Recent Post or Recent Comment widgets, the following errors occur while viewing in IE.
‘title’ is null or not an object, ‘feed.entry’ is null or not an object.
May i know how to solve these errors? Thanks!
‘title’ is null or not an object. I get the same kind of error in IE7. Tried lots of stuff, but can’t get it to go.
http://limasite.info/replica-handbags/vani-replica-handbags-direct-sale.php
Hello, I’m using ur “delicious” blogger template, It’s great
but i’m havin some problems with posting date
i’ve made some changes but…it doesn’t work
I’m kinda newbie. Please a little bit help. Thank you
P.S. http://blogu-negru.blogspot.com
Jack, your googlepage where you host the javascript file for recent post widget had exceeded bandwidth limit.
Once it normal again, I will host the file to other server. Is that ok Jack?
sure. i even recommend you guys to do that
thanks
Hi jack,
great hacks as always,but can you change the recent comment widget to show who commented and on which post?
I found a recent comment widget on another site which showas the names of thise who commented but ot does not integrate well with my red-white template.
@ Faizan
On which site ?
on bloggerbuster…www.bloggerbuster.com/2007/08/create-your-oen-recent-comments-widgets.html
Great info thanks
nice articles
hiiiiiiiii ba con oi o dai nay hay lam do co ai ma vao web site cua anh ay thi vui phai biet nhieu mau va hack blogger tuyet dung la khong ton cong ma tim thay web site nay
writes it verry good
thank you many thinks about you
hello i am hungls87 from to VietNam have a good time !
I’m gonna use this. thanks!
Thanks for this widget. I have had problems with Blogger because it doesn’t send me email anymore when somebody comments my blog. This widget should help me.
the trick to insert recent post and recent comment doesnt not work for me….nothing appear even i did post a test msg…
Hey jack, just want to ask, I’m currently trying to place a small icon beside the start of a comment and repeats for every single one. I have tried using the document.images function in the javascript file, but it doesn’t seem to work. Could you give lend me a hand? Thanks in advance!!
i just wondering why my recent post intermittent on and off…sometime i could see the posting and next day i dont see…
really? what is your blog url?
the same problem here. somehow recent posts have disappeared. just click on random post and the recent posts widget is next to related posts
pheew.. now everything is fine again
others are just too lazy to do whtever u have asked ppl to do here
………..u know am lazy to know wht’s this site abt…….
- and hey thts not my real name 
Thank you Jacky Supit,
I hv been searching for such a gr8 code
Thanks again
Gv
Hey Jack I was wondering if you could give us the code for a tabview widget looking just like that in Doshdosh.com.
hi chetan, actually my friend hoctro have made it before, you can read it here or here. thanks
Just installed this and the top commentator widget on my blogs, much appreciated as ever, thanks.
Hey,
Great post. Few Questions for you.
I want to edit the javascript so the post summer is shown below the headline, and indented. How do I edit the code?
Also, I still don’t understand where to put the java in the widget html box. What other code has to change?
I’m assuming this gets deleted?
Or does the Java code just get pasted above the the other code in the widget area? Sorry for such a long post…
Oops. I meant, does this code get deleted, or replaced by something else? The one inside script tags that references that:
http://files.lifewg.googlepages.com/blogger-widget.js
hi jack..same as robin, sometimes my recent post disappear when i make some changes to my template. mmm..wonder why.. currently, i have to change back to the normal 5 post feed.
i guess you have to host the javascript to your own googlepages sipuri. the javascript you are using now is perhaps hosted on my googlepages account which means used by millions other blogger also.
that makes my googlepages account exceed it’s bandwith limit, so the file become unavailable. thanks
thanks Jack.
may be later i will do that.
anyway, thanks for your answer.
[...] The demo blog has Recent Posts and Recent Comments lists on it. Click the link follow if you want to have your own Recent Posts and Recent Comments on Blogger. [...]
Thanks for the recent post hack! Much appreciated.
unstable..
sometimes it works..sometimes it don’t ??????
you have to host the javascript on to your own googlepages to make sure it works and stable.
if it doesn’t work, that means my googlepages has exceed it’s bandwith limit.
thanks
For recent comments, I recomment this one
http://lvchen716.googlepages.com/rc20_eng
It is nice and easy to setup.
hi jack, how can I make two right sidebars on my blogger just like your two sidebars?
Amrielles last blog post..Visit Indonesia 2008
I am using your widget and it is work
, however it just show comment post and not include name of commentator. Is there any way to work with it?
Halim-Belajar SEOs last blog post..Belajar SEO | Wah, so much competitor lately eh?
[...] know, these widgets was posted so many times on so many blogs, but I still want to re-write them with more details to make it [...]
[...] 2. The recent post is using this recent posts blogger hack. [...]
oh thanks a lot!
i hope !
and wish me luck!