How to add Facebook comments for dynamic websites | 2my4edge

27 June 2016

How to add Facebook comments for dynamic websites

Facebook provides more features, like that, add facebook comments for dynamic php websites. here are going to add facebook comments system to our website or web page. this is the one of the simple way to add facebook comment system to our website. Let see the code and steps to make facebook comments plugin. 



STEP 1 :

Click on this link https://developers.facebook.com/docs/plugins/comments to make facebook comment system.


STEP 2 :
ADD this code in you website.
<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/sdk.js#xfbml=1&version=v2.6
&appId={YOUR_APP_ID}";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>


STEP 3 :
This is to where you want to display the facebook comment system in you website.
<?php $uri = $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; ?>
<div class="fb-comments" data-href="<?php echo $uri; ?>" data-numposts="5">
</div>



6 comments:

  1. Thanks for this post

    ReplyDelete
  2. People can interact with your business as they would with any of their other social networking site friends - they can leave comments and generally enhance the experience of a visit to your page.visit this site

    ReplyDelete
  3. With so many books and articles coming up to give gateway to make-money-online field and confusing reader even more on the actual way of earning money, สีทาบ้าน นครราชสีมา

    ReplyDelete
  4. New site is solid. A debt of gratitude is in order for the considerable exertion. فيس بوك للكمبيوتر

    ReplyDelete
  5. Yes i am totally agreed with this article and i just want say that this article is very nice and very informative article.I will make sure to be reading your blog more. You made a good point but I can't help but wonder, what about the other side? !!!!!!Thanks python course london

    ReplyDelete

^