Search code examples
facebookbuttonfacebook-like

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>

Solution

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