Posted by On 8:38 AM with No comments

Bài viết hướng dẫn cách thức làm sao để tạo 1 widget chỉ hiển thị các bài viết cùng nhãn.

Bước 1. Đăng nhập Blogger
Bước 2. Layout\Add a gadget\HTML
Bước 3. Đặt tên trong mục Title 
Bước 4. Trong mục content nhập code html sau vào: 
<!-- Recent Posts by Label Start -->
<!-- code by http://webads.vn -->
<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://www.dihiis.com//feeds/posts/summary/-/Facebook?max-results=30&alt=json-in-script&callback=recentpostslist"></script>
<span style="font-size: 80%; float:right;">Get this <a href="http://webads.vn">widget</a></span>
<!-- Recent Posts by Label End -->
Chú ý chỉnh sửa các đoạn màu đỏ ở trong code.

Hình demo:


Tuyển tập những ca khúc hay nhất của Lệ Quyên
Next
« Prev Post
Previous
Next Post »