JABZ7SHOP : Web Selling Things With Cheap Price : https://jabz7shop.blogspot.com/ : Go To My Shop Online Now
Bài đăng

Hướng dẫn tạo trang sitemap tuyệt đẹp dành cho blogspot

1 min read

 Xin chào anh em, ở bài viết này mình sẽ chia sẻ một style sitemap nhỏ gọn dễ nhìn dành cho blogspot, style này không yêu cầu bạn chỉnh sửa bất cứ thứ gì mà nó sẽ tự get các bài viết ngay trên blog của bạn luôn.


Hướng dẫn cách thêm sitemap vào blogspot

- Đầu tiên bạn vào Blogspot.com Trang > Trang mới sau đó chuyển qua chế độ soạn thảo HTML và paste code này vào, cuối cùng bạn tiến hành xuất bản trang và xem thử thành quả.
<style>
.toc-header-col1, .toc-header-col2, .toc-header-col3{padding: 10px;background: #d6d6d6;}
.toc-entry-col1, .toc-entry-col2, .toc-entry-col3 {
    background: #e7e7e7;
    color: #fff;
    padding: 10px;
    font-weight: 400;
}
.toc-note{display:none}
.toc-entry-col1 a, .toc-entry-col2 a, .toc-entry-col3 a{font-size: 15px;font-weight:500}
.toc-entry-col2{font-size: 14px;background: #999;}
.toc-entry-col3{background: #555;}
.toc-entry-col3 a{color: #fff;}</style>
<div id='bp_tocm'>
<div id='bp_toc'>
<script type='text/javascript'>
//<![CDATA[
var postTitle=[],postUrl=[],postDate=[],postSum=[],postLabels=[],sortBy="datenewest",tocLoaded=!1,numChars=250,postFilter="",tocdiv=document.getElementById("bp_toc"),totalEntires=0,totalPosts=0; function loadtoc(c){if("entry"in c.feed){var d=c.feed.entry.length;totalEntires+=d;totalPosts=c.feed.openSearch$totalResults.$t;if(totalPosts>totalEntires){var b=document.createElement("script");b.type="text/javascript";startindex=totalEntires+1;b.setAttribute("src","/feeds/posts/summary?start-index="+startindex+"&max-results=500&alt=json-in-script&callback=loadtoc");tocdiv.appendChild(b)}for(b=0;b<d;b++){for(var a=c.feed.entry[b],e=a.title.$t,k=a.published.$t.substring(0,10),l,f=0;f<a.link.length;f++)if("alternate"== a.link[f].rel){l=a.link[f].href;break}var g="content"in a?a.content.$t:"summary"in a?a.summary.$t:"",g=g.replace(/<\S[^>]*>/g,"");if(g.length>numChars)var g=g.substring(0,numChars),h=g.lastIndexOf(" "),g=g.substring(0,h)+"...";h="";if("category"in a){for(f=0;f<a.category.length;f++)h+="<a href=\"javascript:filterPosts('"+a.category[f].term+"');\" title=\"Click here to select all posts with label '"+a.category[f].term+"'\">"+a.category[f].term+"</a>, ";a=h.lastIndexOf(",");-1!=a&&(h=h.substring(0, a))}postTitle.push(e);postDate.push(k);postUrl.push(l);postSum.push(g);postLabels.push(h)}}totalEntires==totalPosts&&(tocLoaded=!0,showToc());sortPosts(sortBy);tocLoaded=!0}function filterPosts(c){postFilter=c;displayToc(postFilter)}function allPosts(){postFilter="";displayToc(postFilter)} function sortPosts(c){function d(a,b){var c=postTitle[a];postTitle[a]=postTitle[b];postTitle[b]=c;c=postDate[a];postDate[a]=postDate[b];postDate[b]=c;c=postUrl[a];postUrl[a]=postUrl[b];postUrl[b]=c;c=postSum[a];postSum[a]=postSum[b];postSum[b]=c;c=postLabels[a];postLabels[a]=postLabels[b];postLabels[b]=c}for(var b=0;b<postTitle.length-1;b++)for(var a=b+1;a<postTitle.length;a++)"titleasc"==c&&postTitle[b]>postTitle[a]&&d(b,a),"titledesc"==c&&postTitle[b]<postTitle[a]&&d(b,a),"dateoldest"==c&&postDate[b]> postDate[a]&&d(b,a),"datenewest"==c&&postDate[b]<postDate[a]&&d(b,a)} function displayToc(c){var d=0,b,a="Click to sort by title",e="Click to sort by date",k="";"titleasc"==sortBy&&(a+=" (descending)",e+=" (newest first)");"titledesc"==sortBy&&(a+=" (ascending)",e+=" (newest first)");"dateoldest"==sortBy&&(a+=" (ascending)",e+=" (newest first)");"datenewest"==sortBy&&(a+=" (ascending)",e+=" (oldest first)");""!=postFilter&&(k="Click to show all posts");b="<table><tr>";b+='<td class="toc-header-col1">';b+='<a href="javascript:toggleTitleSort();" title="'+a+'">Tiêu đề bài viết</a>'; b+="</td>";b+='<td class="toc-header-col2">';b+='<a href="javascript:toggleDateSort();" title="'+e+'">Thời gian</a>';b+="</td>";b+='<td class="toc-header-col3">';b+='<a href="javascript:allPosts();" title="'+k+'">Nhãn của bài đăng</a>';b+="</td>";b+="</tr>";for(a=0;a<postTitle.length;a++)""==c?(b+='<tr><td class="toc-entry-col1"><a href="'+postUrl[a]+'" title="'+postSum[a]+'">'+postTitle[a]+'</a></td><td class="toc-entry-col2">'+postDate[a]+'</td><td class="toc-entry-col3">'+postLabels[a]+"</td></tr>",d++): (z=postLabels[a].lastIndexOf(c),-1!=z&&(b+='<tr><td class="toc-entry-col1"><a href="'+postUrl[a]+'" title="'+postSum[a]+'">'+postTitle[a]+'</a></td><td class="toc-entry-col2">'+postDate[a]+'</td><td class="toc-entry-col3">'+postLabels[a]+"</td></tr>",d++));b+="</table>";c=d==postTitle.length?'<div class="toc-note">Displaying all '+postTitle.length+" posts<br/></div>":'<div class="toc-note">Displaying '+d+" posts labeled '"+(postFilter+"' of "+postTitle.length+" posts total<br/></div>");tocdiv.innerHTML= c+b}function toggleTitleSort(){sortBy="titleasc"==sortBy?"titledesc":"titleasc";sortPosts(sortBy);displayToc(postFilter)}function toggleDateSort(){sortBy="datenewest"==sortBy?"dateoldest":"datenewest";sortPosts(sortBy);displayToc(postFilter)}function showToc(){tocLoaded?(displayToc(postFilter),document.getElementById("toclink")):alert("Just wait... TOC is loading")} function hideToc(){document.getElementById("toc").innerHTML="";document.getElementById("toclink").innerHTML='<a href="#" onclick="scroll(0,0); showToc(); Effect.toggle(\'toc-result\',\'blind\');">\u00bb Show Table of Contents</a> <img src="http://chenkaie.blog.googlepages.com/new_1.gif"/>'};
//]]>
</script>
<script src='/feeds/posts/summary?alt=json-in-script&amp;max-results=500&amp;callback=loadtoc' type='text/javascript'></script>
</div>
</div>
 - Ở phần max result 500 có nghĩa là sitemap này sẽ hiển thị max 500 bài viết của blog, bạn có thể chỉnh sửa con số này sao cho phù hợp với blog của bạn.
Xem Demo Sitemap
00:00 / 00:00

Bạn có thể thích những bài đăng này

  •  Đánh giá chi tiết sản phẩm laptop Lenovo ThinkBook 15 G3 ACL 21A400CFVNLaptop Lenovo ThinkBook 15 G3 ACL 21A400CFVN, chiếc laptop mới nhất đến từ dòng Thinkbook đã xuất …
  •  Dell Latitude 3420 2021 i5 1135G7 Ram 8GB SSD 512 Full HD Cảm Ứng Giới Thiệu Và Đánh GiáTheo dõi Thế Giới Số 247 nhiều hơn để cập nhật thêm nhiều bài viết hay ho hơn nữa! Hãy…
  • 15Th1Laptop Dell dưới 15 triệu tốt nhất 2022 chính là những thông tin cực kỳ hữu ích, giúp bạn có thể tìm kiếm được những chiếc laptop chất lượng nhưng mức giá chỉ trong …
  •  KHAI TRƯƠNG - CHIẾT KHẤU TRỰC TIẾP NẾU Ở 01 NGƯỜI.GIÁ PHÒNG TỪ 3TR8 - 5TR2ĐỊA CHỈ: 380/81/42 Phạm Văn Chiêu, p9, Gò Vấp (Hẻm xe hơi). Khu bàn cờ thông Lê Văn Thọ, Nguyễn Văn …
  • 13Th1Laptop dell core i7 đang được biết đến là dòng sản phẩm tân tiến nhất ngoài thị trường hiện nay, đặc biệt là các dòng chuyên dùng để chơi game. Đối tượng thường hay chọn …
  •  Tết Nguyên Đán luôn là dịp nghỉ ngơi dài ngày của nhiều gia đình hay những người làm việc, học tập mệt mỏi sau một năm. Sẽ có nhiều người lựa chọn đi du lịch Quy Nhơn vào dịp…

Đăng nhận xét