Add facebook to your website

Add facebook to your website

  • May 10, 2018

Facebook is a great social platform where you can share your thoughts. More than billions of peoples have their facebook accounts. So, it is very easy to get peoples reviews through their facebook comments and many of them can share their thoughts on your content. You can integrate facebook website togethet.

You people can also use plugins for integrating your facebook comments and pages to your website. But this is not the efficient way to do the task.

Here are some step which you can follow to integrate facebook with your website.


Step 1 : Add the following JS between the head tag of your website <head>….</head>

<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); = id;
js.src = “// YOUR APP ID HERE”;
fjs.parentNode.insertBefore(js, fjs);
}(document, ‘script’, ‘facebook-jssdk’));</script>


Step 2 : For Facebook Comments you can add the following code where you want facebook comments.

On the blank place you have to insert your website’s URL 

<div class=”fb-comments” data-href=”………………….”
data-num-posts=”5″ data-width=”100%” data-colorscheme=”light” data-mobile=”false”>


Step 3 : For Facebook Page you can add the code below where you want to show your facebook page

On the blank place you have to insert your page slug. For example: url of your fb page is then you have to insert Hotels.Nepal on that blank space.

<iframe src=”………………..%2F&tabs=timeline&width=340&height=500&small_header=false&adapt_container_width=true&hide_cover=false&show_facepile=true&appId” width=”340″ height=”500″ style=”border:none;overflow:hidden” scrolling=”no” frameborder=”0″ allowTransparency=”true” allow=”encrypted-media”></iframe>