Saturday 8 June 2013

How To Create A Sitemap For A Particular Label?


Follow below steps carefully.
  • Log in to your blogger account.
  • Navigate to Pages > New Page > Blank Page.
  • Switch it to HTML mode.
  • Now paste below code in the post body.
    <script type="text/javascript">
    var numposts = 100;
    var standardstyling = true;
    
    function showrecentposts(json) {
      for (var i = 0; i < numposts; i++) {
        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);
        if (standardstyling) document.write('<li>');
        document.write(posttitle);}
        if (standardstyling) document.write('</li>');
    }
    </script>
    <ul>
    <script src="http://www.example.com/feeds/posts/default/-/Your%20Label?orderby=published&amp;alt=json-in-script&amp;callback=showrecentposts&amp;max-results=999"></script>
    </ul>
  • Replace www.example.com with your own blog URL and Your%20Label with label for which you want to create a page.
    Tip: If you have single word as your label page like “SEO” then replace Blogger%20Tricks with SEO but if you have more than one word in your label name then put %20 between them to separate them. The name is case sensitive. So, take care of it.
  • Now click on Publish button.
  • You are done.
Related Posts Plugin for WordPress, Blogger...