0

So this has been driving me crazy, I've been searching similar questions but they all have solutions that seem not to work for me. I am trying to add a like box to my bootstrap website, but it won't appear. I am using the HTML5 version of the widget but have tried others to no avail, have this after my body tag:

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

I made a local verison of all.js since GET was failing to retrieve it from the Facebook servers, even after I uninstalled Ghostery.

Next, I added my like box using:

<div class="fb-like-box" data-href="MYSITEURL" data-colorscheme="light" data-show-faces="true" data-header="true" data-stream="false" data-show-border="true"></div>

With my actual URL of course, and no go, no matter how I arrange the code in a div by itself or anything. Any help is greatly appreciated!

AveryRe
  • 23
  • 1
  • 4

4 Answers4

1

I'm assuming that you're testing the site on a local server, so all you need to do is add "https:" to this line:

js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";

Like this:

js.src = "https://connect.facebook.net/en_US/all.js#xfbml=1";

Cheers!

TLama
  • 75,147
  • 17
  • 214
  • 392
0

I don't think your problem is related to Bootstrap. See http://bootply.com/94974, this use the same code as you do and works well.

Note in your example code js.src = "js/all.js#xfbml=1"; refers to a local all.js where something like //connect.facebook.net/nl_NL/all.js will be needed.

Bass Jobsen
  • 48,736
  • 16
  • 143
  • 224
  • Still doesn't work for me? Even copying that code directly, modifying it to fit my document and everything. I'm completely lost as to why this isn't working. – AveryRe Nov 20 '13 at 00:12
  • how do you load the code? For example in the body or in a modal? Check also http://stackoverflow.com/questions/16905807/how-can-i-list-two-linkedin-follow-buttons-in-a-twitter-bootstrap-dropdown/17052192 and http://getbootstrap.com/getting-started/#third-parties – Bass Jobsen Nov 20 '13 at 07:39
0

It works without problem. Need to be sure the referred fanpage (data-href) is a valid one.

Maxi
  • 36
  • 7
0

It can be FB page permissions setup issue. If the page visibility is restricted for audience from specific location(s), then the likebox doesn't appear.