Sau đây là một thủ thuật blogspot nhỏ giới thiệu tới cả nhà.
B1. Thêm đoạn mã bên dưới vào trước thẻ
</body>
. đoạn code này là của facebook .<div id="fb-root"></div><script>(function(d, s, id) {var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) return;js = d.createElement(s); js.id = id;js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";fjs.parentNode.insertBefore(js, fjs);}(document, 'script', 'facebook-jssdk'));</script>
Và đoạn code sau lên trên thẻ đóng </head>
<script type='text/javascript'>//<![CDATA[var purl= location.href;var fb_href = purl.substring(0,purl.indexOf(".html")+5);var fbcm ='<div class="fb-comments" data-href="'+fb_href+'" data-num-posts="5" data-width="540"></div>';//]]></script>
Một số lưu ý nhỏ ở đây :
data-num-post=5 : số comment được hiển thị. Nếu vượt quá sẽ tự động gộp comment
data-width=540 : chiều rộng khung comment facebook hiển thị
Bây giời mới đến giai đoạn thêm vào
Tìm một trong các đoạn code như sau: <b:include data='post' name='post'/>
Rồi thêm ngay dưới nó đoạn code sau:
<b:if cond='data:blog.pageType == "item"'>
<script type='text/javascript'>
document.write(fbcm);
</script>
</b:if>
Lưu lại vậy là Xong !Hài hước hội
Không có nhận xét nào:
Đăng nhận xét