How to Install Recent Post Widget In Blogger

INSTALL RECENT POST WIDGET IN BLOGGER

HOW TO INSTALL RECENT POST WIDGET IN BLOGGER

This is an New version of my Recent Posts Widget .This Widget will help you to display the most Recent Posts on your Blog’s Sidebar. 
Today I Am Showing How To Add Recent Post Widget in Blogger . Ok Lets Start

Login to Blogger >layout > Add Widget > HTML/javascript and paste the following code in it.

<style scoped='' type="text/css">
ul#recent-posts{list-style:none;margin:0;padding:0}li.recent-posts{display:block;clear:both;overflow:hidden;list-style:none;border-bottom:1px solid #e3e3e3;word-break:break-word;padding:10px 0;margin:0;}
li.recent-posts:last-child{border-bottom:0;}
li.recent-posts a{color:#444;}li.recent-posts a:hover{color:#444;text-decoration:underline}
</style>
<ul id="recent-posts"></ul>
<script>
//<![CDATA[
var homePage = "http://www.Your-blog-URL.com",
numPosts = 5;
function recentPosts(a){if(document.getElementById("recent-posts")){var e=a.feed.entry,title,link,content="",ct=document.getElementById("recent-posts");for(var i=0;i<numPosts;i++){for(var j=0;j<numPosts;j++){if(e[i].link[j].rel=="alternate"){link=e[i].link[j].href;break}}var title=e[i].title.$t;content+='<li class="recent-posts"><a href="'+link+'" title="'+title+'" target="_blank" rel="nofollow">'+title+'</a></li>'}ct.innerHTML=content}}var rcp=document.createElement('script');rcp.src=homePage+'/feeds/posts/summary?alt=json-in-script&orderby=published&max-results='+numPosts+'&callback=recentPosts';document.getElementsByTagName('head')[0].appendChild(rcp);
//]]>
</script>

Note - Replace Your Blog URL With Marked Code And the Number of Posts to be Desplayed.

Save the Widget And See The Results....

Hope You LIke It...

Post a Comment

Previous Post Next Post