-->

Hiển thị bài viết theo nhãn ngoài trang chủ cho Blogspot


Sau đây mình xin hướng dẫn các bạn cách làm hiển thị bài viết theo nhãn ngoài trang chủ cho Blogspot.

1. Đăng nhập Blogger
2. Design\Layout\Add a gadget\HTML/JavaScript Add
3. Đặt tên trong mục Title
4. Trong mục content nhập code sau vào:
<!-- Recent Posts by Label Start -->
<!-- code by https://lenammath.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://lenammath.blogspot.com/feeds/posts/summary/-/Nhãn Của Bạn?max-results=30&alt=json-in-script&callback=recentpostslist"></script>
<span style="font-size: 80%; float:right;">Get this <a href="https://www.youtube.com/channel/UCradZkKU2qCTHFbo7D1THYQ">widget</a></span>
<!-- Recent Posts by Label End -->
Chú ý:  Các bạn thay các phần chữ màu xanh in đậm theo link của các bạn nhé.

  • http://lenammath.blogspot.com/: Thay bằng domain của bạn
  • Nhãn Của Bạn: Thay bằng tên nhãn của bạn
Mọi thắc mắc vui lòng liên hệ: Email: lenam.math@gmail.com hoặc comment ở dưới mình sẽ trả lời cho các bạn nhé.

Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.

Disqus Comments