Create HTML Sitemap for Specific Label in Blogger
Introduction
I've seen too many bloggers that ask about creating an HTML sitemap for a specific label in Blogger. So today, I decided to make a post about this topic! And I hope it solves your problem.Add Single Labelled HTML Sitemap
Go to Blogger.com >> Pages >> Add New Page. Then, just paste the code that's given below!Code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
var totalposts = 200; | |
var standardstyling = true; | |
function showrecentposts(json) { | |
for (var a = 0; a < totalposts; a++) { | |
var entry = json.feed.entry[a]; | |
var posttitle = entry.title.$t; | |
var posturl; | |
if (a == json.feed.entry.length) break; | |
for (var b = 0; b < entry.link.length; b++) { | |
if (entry.link[b].rel == 'alternate') { | |
posturl = entry.link[b].href; | |
postimg = entry | |
break; | |
}} | |
posttitle = posttitle.link(posturl); | |
if (standardstyling) document.write('<li>'); | |
document.write(posttitle);} | |
if (standardstyling) document.write('</li> | |
'); | |
} | |
</script> | |
<br /> | |
<ul> | |
<h3>Label</h3> | |
<script src="https://blog-url.blogspot.com//feeds/posts/default/-/label?orderby=published&alt=json-in-script&callback=showrecentposts&max-results=999"></script> | |
</ul> |
Label -> your label
blog-url -> your blog url
label -> the label you want
P.s. If your blogger label is separated in two sentences E.x. "Popular Posts" then the link will be "popular%20posts.". So, just replace the space with %20.
And that's all! I hope it works for all of you!
not working dear
ReplyDeletesame here, not working
ReplyDelete