New
Loading...
Trong blogger thường hỗ trợ sẵn khung comment bằng tài khoản Google và nhiều openid khác nhau nhưng không hỗ trợ comment Facebook, vì vị muốn thêm comment Facebook bạn phải tự tay làm. Nhưng cũng không khó lắm đâu các bạn, chỉ cần làm theo các bước sau là bạn cũng có thể làm dễ dàng.


Bước 1: Đăng nhập blogger => Template => Edit HTML => Tìm (Ctrl + F) đoạn <html và thành <html xmlns:og='http://ogp.me/ns#'

Bước 2: Tìm  <body> thêm đoạn code sau vào:

<div id="fb-root"></div>
    <script>
    window.fbAsyncInit = function() {
    FB.init({
    appId : 'YOUR_APP_ID',
    status : true, // check login status
    cookie : true, // enable cookies to allow the server to access the session
    xfbml : true // parse XFBML
    });
    };
    (function() {
    var e = document.createElement('script');
    e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
    e.async = true;
    document.getElementById('fb-root').appendChild(e);
    }());
    </script

Thay   YOUR_APP_ID thành App ID của bạn

Bước 3: Tìm thẻ <head> thêm vào bên dưới đoạn code sau:
<meta property = "fb:app_id" content= "YOUR_APPLICATION_ID" />Thay   YOUR_APP_ID thành App ID của bạn

Bước 4: Tìm đoạn code sau: <div class='post-footer-line post-footer-line-2'>

Dán đoạn code sau vào bên dưới:

<b:if cond='data:post.isFirstPost'>   
<script>(function(d){
 var js, id = &#39;facebook-jssdk&#39;; if (d.getElementById(id)) {return;}
 js = d.createElement(&#39;script&#39;); js.id = id; js.async = true;
 js.src = &quot;//connect.facebook.net/en_US/all.js#xfbml=1&quot;;
 d.getElementsByTagName(&#39;head&#39;)[0].appendChild(js);
}(document));</script>
</b:if>
<a expr:href='data:post.url + &quot;#fb-root&quot;'><fb:comments-count expr:href='data:post.canonicalUrl'/> comments</a>
 Bước 5: Tìm <div class='post-footer-line post-footer-line-3'>
Dán đoạn code sau vào bên dưới:

<b:if cond='data:blog.pageType == &quot;item&quot;'>
<div id='fb-root'/>
<script>(function(d){
 var js, id = &#39;facebook-jssdk&#39;; if (d.getElementById(id)) {return;}
 js = d.createElement(&#39;script&#39;); js.id = id; js.async = true;
 js.src = &quot;//connect.facebook.net/en_US/all.js#xfbml=1&quot;;
 d.getElementsByTagName(&#39;head&#39;)[0].appendChild(js);
}(document));</script>
<div style='margin: 20px 0 0 0;'><fb:comments colorscheme='light' expr:href='data:post.canonicalUrl' expr:title='data:post.title' expr:xid='data:post.id' width='900'/></div>
</b:if>
Sau đó các bạn lưu lại và chạy thử trong trang chi tiết bài viết xem kết quả nhé.


Chúc các bạn thành công!

Bạn đang sở hữu một website hay blog, bạn muốn phát triển nó thì không thể bỏ qua việc quảng bá nó trên các công cụ mạng xã hội như Facebook, Google plus... Sau đây ivshare sẻ hướng dẫn các bạn gắn nút Google plus vào website để bạn hoặc người dùng có thể chia sẻ lên mạng xã hội lớn thứ 2 thế giới này.


Bước 1: Chép đoạn code sau dán vào trước thẻ </head>  hoặc gắn vào bất cứ chỗ nào bạn thấy tiện trong thẻ <body> trong html:
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
Bước 2: Chép đoạn code sau dán vào vị trí bạn muốn xuất hiện nút Google+:
<g:plusone size="tall"></g:plusone>
 Bạn có thể chọn lại style cho nút Google bằng cách sửa tall thành một trong những style sau:



Sau đó lưu lại và refesh lại trình duyệt xem kết quả nhé!

Chúc các bạn thành công!