Đăng nhập Blogger ~> Bố cục ~> Thêm tiện ích HTML/Javascript
Dán đoạn code này vào rồi Lưu lại
<!-- Popular posts with comment count Start --> <script type="text/javascript"> function getYpipePP(feed) { document.write('<ol style="">'); var i; for (i = 0; i < feed.count ; i++) { var href = "'" + feed.value.items[i].link + "'"; var pTitle = feed.value.items[i].title; var pComment = " \(" + feed.value.items[i].commentcount + "\)"; var pList = "<li>" + "<a href="+ href + '" target="_blank">' + pTitle; document.write(pList); document.write(pComment); //to remove comment count delete this line document.write('</a></li>'); } document.write('</ol>'); } </script> <script src="https://pipes.yahoo.com/pipes/pipe.run? YourBlogUrl=http://dxoan.blogspot.com &ShowHowMany=10 &_id=390e906036f48772b2ed4b5d837af4cd &_callback=getYpipePP &_render=json" type="text/javascript"></script> <!-- Popular posts with comment count End -->
Thay http://dxoan.blogspot.com bằng địa chỉ blog của bạn
ShowHowMany=10
là số bài viết được hiển thị trên bảng xếp hạng
Mẫu 2
Bước 1: Đăng nhập Blogger ~> Mẫu ~> Chỉnh sửa HTML
Tìm thẻ </Group>
, thêm đoạn code ngay dưới thẻ </Group>
đầu tiên tìm được (thẻ này nằm bên trong <b:skin></b:skin>
)
<Group description="Most Commented" selector=".most-commented"> <Variable name="most.commented.background1" description="background color1" type="color" default="#fa4242" value="#ee377a"/> <Variable name="most.commented.background2" description="background color2" type="color" default="#ee6107" value="#fcad37"/> <Variable name="most.commented.background3" description="background color3" type="color" default="#f0f" value="#f8e000"/> <Variable name="most.commented.background4" description="background color4" type="color" default="#ff0" value="#c7e93d"/> <Variable name="most.commented.background5" description="background color5" type="color" default="#0ff" value="#5ebded"/> </Group>
Với những template không có thẻ </Group>
thì hãy thêm đoạn code trên vào bên dưới thẻ <b:skin><![CDATA[
Tiếp theo, thêm đoạn code sau vào trước thẻ đóng ]]></b:skin>
.comment-count { padding: 3px 10px; background: #fff; color: #000; font-size: 10px; float: right; } .most-commented ul { padding: 0px !important; font-family: Century Gothic, sans-serif; } .most-commented ul li {