Thêm facebook comment vào Website

Ah ha… hôm nay nghịch tí, thử làm theo bài trên blog của Mr. Thach Pham để chèn facebook comment vào wordpress. Tóm tắt lại các bước thế này:

1. Tạo facebook App: https://developers.facebook.com

2. Thêm code fbcomment vào website: vào trang này https://developers.facebook.com/docs/plugins/comments và ấn nút Get Code phía dưới (không cần quan tâm cái khung tùy chỉnh ở trên).
2.1) Copy đoạn code số 1 bỏ vào file header.php (đặt sau thẻ </head>).

2.2) Chèn code này vào bên dưới thẻ <head> và sửa APP ID thành App ID của bạn và USER ID là số ID của bạn trên Facebook (tự mày mò kiếm USER ID đi).

<meta property=”fb:app_id” content=”APP ID” />
<meta property=”fb:admins” content=”USER ID”/>

2.3) Chèn đoạn dưới đây vào file single.php hoặc comments.php (nếu có)

<div class=”fb-comments” data-href=”<?php the_permalink(); ?>” data-numposts=”20″ width=”100%” data-colorscheme=”light” data-version=”v2.3″></div>

or

<div class=”fb-comments” xid=”<?php the_ID(); ?> data-numposts=”20″ data-colorscheme=”light” data-version=”v2.3″></div>

Sự khác biệt là cái trên dùng permalink, cái dưới dùng ID của bài post (dùng cái dưới sẽ tối ưu hơn trong trường hợp có thay đổi permalink của bài viết).

P/s: lưu ý cái bảng thông số này của facebook comments để có thể tùy chỉnh width… something…

RELATED POSTS

AWS EKS pod-identity-association

The association is a two-sided thing — the AWS side links (namespace, serviceAccount) → IAM role, and the Kubernetes side is just which SA a pod runs as. There's no direct kubectl resource that shows the combined picture, but here's

Read More »

Căn hộ dành cho ai !

Đất giá 20 trđ/m2 thì căn hộ sẽ là 20:5:0.6 = 7trd Xây nhà liền thổ trệt + 1 lầu giá 8 trđ/m2 thì căn hộ sẽ là 1.5×8 : 0.6 = 20 trđ ( tim tường ) Căn hộ

Read More »
Share the Post: