Error Facebook plugin does not count amount of comments

Asked

Viewed 409 times

2

I used the Facebook plugin on my site, for the buttons to like (like), share (share), face box (facepile) and comments (comments).

Everything works, except the comment counter in each post, all codes are correct, I used this script in Portuguese that facebook provides:

<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/pt_BR/sdk.js#xfbml=1&appId=300497003454434&version=v2.0";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

The strange thing is that if I use the script in English, everything works, only the description of the buttons in English:

<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>

How do I display the correct amount of comments?

  • 1

    You’re using the first one with your APP ID. But you already tried to trade: js.src = "//connect.facebook.net/en_US/all.js#xfbml=1"; Por: js.src = "//connect.facebook.net/pt_BR/all.js#xfbml=1"; ?

  • Without the application ID it loads the same way as the en_US language script, if I clear the cache and load the page, it even counts the comments, but the like and share plugins do not work, however this seems to be a native problem of the plugin, as several other pages present the same problem, G+ > Fb. But if I create a FB app and link it with the SDK of the plugin tb n shows the amount of comments.

  • Yes, everyone is always messed up by the Facebook API, that’s normal. But you have to see, you couldn’t have more than one SDK code on your page, anything that works with just one, if you’re using more than one can cause that same behavior.

  • I know, I’m only using a SDK code, Good even is google q has a Suport and much better documentation, in addition to loading a 10x faster, if I clear the cache and reload the page the plugins FB n loads, only the second made q I update, sad...

  • Did you find a solution? Poste as an answer to help other people.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.