Xem demo bên dưới để thấy rõ hơn.
XEM DEMO 1 XEM DEMO 2
» Bắt đầu thủ thuật
1- Đăng nhập vào tài khoản Blogger
2- Vào phần Bố cục (Layout)
3- Thêm 1 HTML/Javascript và thêm vào code bên dưới
- Ở đây mình cung cấp 2 lại liệt kê.Loại 1 không đánh số thứ tự
Loại 2: CÓ đánh số số thứ tự.
- Nếu thích loại nào hãy copy code loại đó và dán vào HTML/Javascript hoặc bài viết của bạn.
Loại 1 không đánh số thứ tự
Ảnh minh họa:<!-- 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 -->
Loại 2: CÓ đánh số số thứ tự.
Ảnh minh họa:<!-- Recent Posts by Label Start -->
<!-- code by http://namkna.blogspot.com/ -->
<script type="text/javascript">
function recentpostslist(json) {
document.write('<ol>');
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('</ol>');
}
</script>
<script src="http://namkna.blogspot.com/feeds/posts/summary/-/Blogspot-tips?max-results=2000&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.
- 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ị.
4- Lưu mẫu lại và xem thành quả.
Chúc thành công!
Theo: Namkna.blogspot.com
Bình Luận[ 0 ]
Post a Comment