Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

My facebook like button is not showing up

I looked at previous asked questions about the facebook like button and didnt see anything that was wrong with my code. Here is what I have:

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


</body>
like image 873
DWalk Avatar asked Dec 03 '25 10:12

DWalk


2 Answers

After adding the code for initializing the Facebook's Javascript SDK you also have to add the code to display the Like button at the required place. The generic code for it is

<div class="fb-like" data-send="true" data-width="450" data-show-faces="true">
</div>

If you want you can further customize it by checking documentation here.

like image 178
Anvesh Saxena Avatar answered Dec 05 '25 00:12

Anvesh Saxena


Had the same problem, once I published the page, the like buttons showed up

facebook page : settings : Page Visibility : Page published

(the page was "unpublished" by default even after I did publish it for the first time)

like image 38
Yovav Avatar answered Dec 05 '25 00:12

Yovav