Convert Blog Posts into List View for blogger website

What to do

  • Open Blogger Dashboard
  • Choose a place where you want to add this code
  • Copy below code add Html/JS gadget 
  • Paste the copied code in it

<!--Powered by theAShub-->
<script type="text/javascript">
function recentpostslist(json) {
 document.write('<ul>');
 for (var i = 0; i < json.feed.entry.length; i++)
 {
    for (var j = 0; j < json.feed.entry[i].link.length; j++) {
      if (json.feed.entry[i].link[j].rel == 'alternate') {
        break;
      }
    }
var entryUrl = "'" + json.feed.entry[i].link[j].href + "'";//bs
var entryTitle = json.feed.entry[i].title.$t;
var item = "<li>" + "<a href="+ entryUrl + '" target="_blank">' + entryTitle + "</a> </li>";
 document.write(item);
 }
 document.write('</ul>');

 }
</script>
<script src="https://theanuragsinghhub.blogspot.com//feeds/posts/summary/-/Blogger?max-results=10&amp;alt=json-in-script&amp;callback=recentpostslist"></script>

Output 👀

Understanding codes 💡

<script src="https://theanuragsinghhub.blogspot.com//feeds/posts/summary/-/Blogger?max-results=10&amp;alt=json-in-script&amp;callback=recentpostslist"></script>
  • Replace blog URL with your own website link
  • Blogger is label of post which are converts into list view. Change it with your needful label name.
<script src="https://theanuragsinghhub.blogspot.com//feeds/posts/summary/-/Blogs?max-results=10&amp;alt=json-in-script&amp;callback=recentpostslist"></script>
  • max-results=10 is the number of blog post which shows in list view

theAShub Tutorials Point,

We appreciate your attention for this post and eagerly await your response. Thankyou

Comments