Download our web app! Download

Thêm Facebook comment cho Blogspot có thể quản lí Comment

Bước 1: Tạo app mới
Để tạo app mới các bạn truy cập vào https://developers.facebook.com/. Sau đó chọn Register as a Developer. Tiếp theo điền các thông tin và kích hoạt App. Bạn hãy đọc qua bài viết “Hướng dẫn tạo App Facebook và lấy appID” để có thể biết rõ các bước thực hiện nhé!
Bước 2: Các bạn vào chỉnh sửa Template
Sau đó copy đoạn code sau đây và dán vào trên thẻ </body> ( để tìm thẻ ấn  Ctrl+F )
<div id="fb-root"></div>
<script>
  window.fbAsyncInit = function() {
    FB.init({
      appId      : '663330627477102',
      xfbml      : true,
      version    : 'v2.3'
    });
  };
  (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/sdk.js";
     fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'facebook-jssdk'));
</script>
Trong đó 663330627477102 là ID của app mà chúng ta mới tạo.
Bước 3: Hiển thị khung comment dưới mỗi bài viết
Để có thể hiển thị được khung comment các bạn cần tìm đến đoạn code sau. 
Chủ đề > chỉnh sửa HTML sau đó ấn CTRL+F
<b:includable id='comments' var='post'>
Sau đó copy đoạn code dưới đây và pate vào dưới dòng code trên.
<div class='fb-comments' data-num-posts='5' data-width='100%' expr:href='data:post.canonicalUrl'/>
Bước 4: Quản lý Comment
Để nhận được thông báo khi có người bình luận vào bài viết thì các bạn cần chèn hai thẻ meta này vào trước thẻ </head> trong template của bạn.
<meta content='ID Facebook của bạn' property='fb:admins'/>
<meta content='ID APP' property='fb:app_id'/>
Với fb:admins là ID tài khoản của bạn, còn fb:app_id là ID app của bạn.
Bước 5  : Lưu chủ đề lại 
Để quản lý các bình luận trên blog/website của mình, các bạn truy cập vào địa chỉ
https://developers.facebook.com/tools/comments

Rate this article

Loading...

Đăng nhận xét

© 1Hip. All rights reserved.

Cookies Consent

This website uses cookies to ensure you get the best experience on our website.

Cookies Policy

We employ the use of cookies. By accessing Lantro UI, you agreed to use cookies in agreement with the Lantro UI's Privacy Policy.

Most interactive websites use cookies to let us retrieve the user’s details for each visit. Cookies are used by our website to enable the functionality of certain areas to make it easier for people visiting our website. Some of our affiliate/advertising partners may also use cookies.

Gửi Ticket
Gửi Email
Điện thoại