Reputation: 57
I'm trying to automatically embed Facebook comments on my page to my blog.
I mean, if a person posts a comment on an article on my Facebook page, I want this comment to be posted on my site, inside the article page (same article).
How can I do that? I'm trying, but no success.
It's a WordPress site: http://www.smokebuddies.com.br/
My Facebook page: facebook.com/SmokeBuddies/
Here's what I need, highlighted in red: https://i.sstatic.net/kOG8I.jpg
Upvotes: 1
Views: 127
Reputation: 57
I managed to settle here after a lot of fighting, the flow and the following:
Insert the meta tag
<meta property = "fb: app_id" content = "(your app id)">
before the head is closed;
Insert jdk shortly after opening body:
<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/sdk.js#xfbml=1&version=v2.10&appId=(your app id)";
fjs.parentNode.insertBefore (js, fjs);
} (document, 'script', 'facebook-jssdk')); </ script>
Insert a tag in the location that you want to appear in the comments box:
<div class="fb-comments" data-href="" data-numposts="8" data-width="100%"></div>
In the comment moderation setting, click on creating and active comment mirroring or mirrored comments, something like this. https://developers.facebook.com/tools/comments
At that time, the comments are already looking like mirroring.
Upvotes: 1
Reputation: 444
You can iframe embed a Facebook Post or a Single Comment, OR add a unique Comment Thread to your site by enabling Facebook SDK (adding some javascript to your wordpress site) https://developers.facebook.com/docs/javascript/quickstart
I created a custom plugin for wordpress that turns the SDK on and wrote this guide to help users embed Facebook content into their post. http://aurora.uconn.edu/2017/08/08/facebook/
Upvotes: 0