Bạn có muốn liệt kê tất cả các bài viết gần đây nhất của bạn theo loại / nhãn? .
bình thường để liệt kê các bài viets của blog bạn hay các blog khác bạn
phải tự thêm liên kết linklist nhưng với thủ thuật này Các bài viết sẽ cập nhật tự động.
» Bắt đầu thủ thuật
» Bắt đầu thủ thuật
- Đăng nhập vào tài khoản Blogger
- Vào phần Thiết kế (Design)
- Thêm 1 HTML/Javascript và thêm vào code bên dưới
<!-- Recent Posts by Label Start --> <!-- code by http://namkna.blogspot.com/ --> <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="http://namkna.blogspot.com/feeds/posts/summary/-/Blogspot-tips?max-results=20&alt=json-in-script&callback=recentpostslist"></script> <span style="font-size: 80%; float:right;">Get this <a href="http://namkna.blogspot.com/2012/02/liet-ke-tieu-de-bai-viet-gan-day-nhat.html">widget</a></span> <!-- Recent Posts by Label End -->Trong đó:
- Thay http://namkna.blogspot.com/ thành địa chỉ Blog của bạn.
- Thay số 20 trong max-results=20 thành số bài viết bạn muốn hiển thị.
- Thay Blogspot-tips thành nhãn mà bạn muốn hiển thị.
Chúc thành công!
0 nhận xét:
Đăng nhận xét