Question

I implanted facebook comments widget in my site.

Created an test app for site development and implanted this code after

<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/ru_RU/all.js#xfbml=1&appId=737848022908232";
        fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));
</script>

Then in necessary place wrote this.

<div class="fb-comments" data-href="http://marker.s45.webhost1.ru/blog/" data-width="910"></div>
</div>

There are two problems

1)If i comment on one post, the comment will show on every post - I want every post to have their own comments

2)When i comment on the post, in my fb profile doesnt show that i just commented.. It should

What i did wrong?

Was it helpful?

Solution

1) data-href needs to be an absolute and unique URL for the particular blog post, like so -

<div class="fb-comments" data-href="<?php the_permalink(); ?>" data-width="910"></div>

See the Wordpress Codex for documentation on the_permalink.

2) For your comment to display on your Facebook Profile you must tick the 'Post to Facebook' checkbox - see the Facebook Comments Widget documentation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top