How to place Facebook Widget in your Webpage?

Facebook Like and Share Widget Code:

In order to add the Facebook like and share widget in your website, you need to add the below mentioned code in your webpage.
  •  You need to include the JavaScript SDK on your page once, ideally right after the opening <body> tag - It is the best practice to add the Facebook JS SDK Code separately
     <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_GB/sdk.js#xfbml=1&version=v2.5";
     fjs.parentNode.insertBefore(js, fjs);
     }(document, 'script', 'facebook-jssdk'));</script>

  • You need to place the below code for your plugin where ever you want the plugin to appear on your page.
         <div class="fb-page" data-href="https://www.facebook.com/facebook" data-width="280"           data-height="500" data-small-header="false" data-adapt-container-width="true" data-             hide-cover="false" data-show-facepile="true"><div class="fb-xfbml-parse-ignore">                   <blockquote cite="https://www.facebook.com/facebook"><a                                                              href="https://www.facebook.com/facebook">Facebook</a></blockquote></div></div>

*Note: The recommended Facebook Like and share widget placement in your website is at top right corner of our website or at footer section.

After placing the code your widget looks like:

Unknown Unknown Author

Labels