How to show recent posts in Blogger 2020

Recent Posts permits guests to quickly see the foremost recent diary posts if they're interested. during this post, we'll see the way to show recent posts in Blogger diary that i attempted. this can add a gismo and list the most recent diary posts on Blogger diary. By default, Google Blogger provides gismos for "popular posts" however there's no widget provided for "recent posts". This gismo once else can permit guests to quickly see the foremost recent diary posts within the sidebar or where you add the gismo to.
how to show recent posts in blogger,recent posts in blogger.com,blogspot recent posts,  recent posts in blogspot

recent posts widget in blogger how to show recent posts in blogger , we have a tendency to login to Blogger dashboard and navigate to "layout", then click on the "add a gadget". If we are able to realize the widget or gismo we wish to feature, we have a tendency to merely click on the sign "+" and therefore the gismo is else. I wished to check this out and explore for "recent posts" widgets in Google Blogger and will not realize one.




  • Login to Blogger Dashboard > Layout
  • In the template area where you want the widget to appear, click on "add a gadget"
  • In the gadgets selection window, select "Add HTML/JAVASCRIPT"
  • Copy and paste the code below:
<script>var numposts =5; var showpostdate = false; var showpostsummary = false; var numchars = 100; </script>
<script src="http://blogname.blogspot.com/feeds/posts/default?orderby=published&alt=json-in-script&callback=rp">
</script>

Configuration:

Edit blog name: 
blogname: replace the blogname with your blog name.
Number of recent posts to show:
numposts=5: displays 5 posts. change it to the number of recent post links to show.
Show the post date or not:
showpostdate: true or false
Show post summary or not:
showpostsumamry: true or false
How many character to show in post summary?
numchars: enter the number of character to display




  • Click ok. Widget is added.
  • Click "Save Arrangement"
  • Click on "View Blog" and check if the recent posts widget appears.
If the recent posts does not display, do the following:
  • Click on "Template" from the left Blogger sidebar menu 
  • Click "Edit HTML"
  • Click anywhere in the code area and press Control(CTRL)+F
  • Type "</html> and hit enter to search
  • Paste the code below right above </html>
<!-- FOR RECENT POSTS. Widget also added-->
  <script type='text/javascript'>//<![CDATA[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>')}//]]></script><!-- RECENT POSTS. Widget also added--> [credits for the code: newbloggerthemes.com]
  •  Click "Save Template"
  • Click View Blog and see if the recent posts  appears.
I have tried the above code and it works. A recent posts widget was successfully added and recent blog posts are displayed.




How to show recent posts in Blogger blog using Feed widget?
If you simply want to display list of recent post links of up to 5 links, then you can also do so by using the Blogger "Feed" widget. To add the Feed widget, do the following:
  • Go to Layout and add a gadget like normally. 
  • Find widget "Feed" and add.
  • Enter the feed URL
    • By default it is: "http://blogname.blogspot.com/feeds/posts/default" 
    • If you have already setup a redirect feed such as "Feedburner", get the URL from Settings > Other > under "Site Feed" > "Post Feed Redirect URL" > copy the URL from there

Comments

Popular posts from this blog

HSC all text book Download | এইচএসসি সব পাঠ্য বই ডাউনলোড

একাদশ দ্বাদশ শ্রেণীর বই সমূহ ডাউনলোড – HSC Books Download pdf

আপনি 2022 সালে এই বক্স অফিস হিটগুলির কয়টি দেখেছেন?