We all always tried to show more recent Posts but we always failed because bloggers Feed Widget it only shows 5 posts only but today I m going to tell you how to show 10 recent posts or more. for this you just have add a simple JavaScript. So now lets get Started.
Follow the Following steps:
1. Login in to your blogger dashboard .
2. Click on the layout Link.
3. Click on Add a Gadget Link.
4. Then Select HTML/JavaScript Add .
5. Paste the Following code and your Done.
<script>
function rpundefinedjson) {
document.writeundefined’<ul>’);for undefinedvar i = 0; i < numposts; i++) {
document.writeundefined’<li>’);
var entry = json.feed.entry[i];
var posttitle = entry.title.$t;
var posturl;if undefinedi == json.feed.entry.length) break;
for undefinedvar k = 0; k < entry.link.length; k++) {
if undefinedentry.link[k].rel == ‘alternate’) {
posturl = entry.link[k].href;
break;
}
}posttitle = posttitle.linkundefinedposturl);
var readmorelink = “undefinedmore)”;
readmorelink = readmorelink.linkundefinedposturl);
var postdate = entry.published.$t;
var cdyear = postdate.substringundefined0,4);
var cdmonth = postdate.substringundefined5,7);
var cdday = postdate.substringundefined8,10);
var monthnames = new Arrayundefined);
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 undefined”content” in entry) {
var postcontent = entry.content.$t;
} else if undefined”summary” in entry) {
var postcontent = entry.summary.$t;
} else
var postcontent = “”;
var re = /<\S[^>]*>/g;
postcontent = postcontent.replaceundefinedre, “”);
document.writeundefinedposttitle);if undefinedshowpostdate == true) document.writeundefined’ – ‘ + monthnames[parseIntundefinedcdmonth,10)] + ‘ ‘ + cdday);
if undefinedshowpostsummary == true) {
if undefinedpostcontent.length < numchars) {
document.writeundefinedpostcontent);
} else {
postcontent = postcontent.substringundefined0, numchars);
var quoteEnd = postcontent.lastIndexOfundefined” “);
postcontent = postcontent.substringundefined0,quoteEnd);
document.writeundefinedpostcontent + ‘…’ + readmorelink);
}
}
document.writeundefined’</li>’);
}
document.writeundefined’</ul>’);}
</script><script>
var numposts = 10;
var showpostdate = false;
var showpostsummary = false;
var numchars = 100;
</script><script src=”http://YOURBLOG.blogspot.com/feeds/posts/default?orderby=published&alt=json-in-script&callback=rp”></script>
<br />
<div></div><p style=”text-align:center;”><a href=”http://www.best2know.info/2010/04/how-to-show-10-posts-instead-of-5-posts.html” title=”Grab this wiget” target=’_blank’><b>Grab this Widget<b></b></b></a></p>
In the Above code change the
YourBlog.blogspot.com
with your link of your site or of your custom domain.
And if you want to show more than 10 posts then change the number which is
in red color to the number of how much posts you want to show.

Comments on this entry are closed.