Facebook comments on my website work well except the fact when someone comments on one article that same comment shows up on every article on the website. Obviously, I don't want that. What I did is basically copy and paste code offered on developers.facebook.com:
`<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/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>`
`<div class="fb-comments" data-href="http://example.com" data-num-posts="2" data- width="470"></div>`
What did I do wrong? I would appreciate any help.
Vio
You using same data-href
attribute for comments social plugin on all pages (linking comments to http://example.com)
You should either provide URL of your post or leave this attribute empty (current page URL is used by default if this attribute missing or empty) on each page comments social plugin placed.
I have same problem, tried the solution offered by "juicy scripter" and I get "The comments plugin requires an href parameter." Then I found out juicy's solution should work if you use the XFBML version of the plugin.
In any case the solution I implemented on my static php site was to replace the href/URL with this code
<?php echo('http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); ?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With