Làm thế nào để hiển thị tổng số bài gửi và tổng số nhận xét trên blogger?
- Chỉ cần vào Bố cục (layout) >> Thêm Tiện ích >> HTML/Javascript và thêm vào đoạn mã dưới đây:
- Chỉ cần vào Bố cục (layout) >> Thêm Tiện ích >> HTML/Javascript và thêm vào đoạn mã dưới đây:
<script type="text/javascript">- Lưu lại và xem kết quả
function showPostCount(json) {
document.write(parseInt(json.feed.openSearch$totalResults.$t, 10));
}
</script>
Có tổng cộng:<br />
⇒ <strong><script src="/feeds/posts/summary?max-results=0&alt=json-in-script&callback=showPostCount"></script></strong> Bài gửi<br />
⇒ <strong><script src="/feeds/comments/summary?max-results=0&alt=json-in-script&callback=showPostCount"></script></strong> Nhận xét
Post a Comment