JS - Facebook comment in article

0 votes
87 views
added Jul 19, 2019 in Javascript by LC Marshal Captain (25,770 points)
<script>
  window.fbAsyncInit = function() {
  FB.init({
    appId      : '8xxxxxxxxxxxx',
    xfbml      : true,
    version    : 'v3.0'
  });
  FB.AppEvents.logPageView();
  };

  (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 = "https://connect.facebook.net/en_US/sdk.js";
   fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'facebook-jssdk'));
</script>

<div class="m-b-30">
  <div class="fb-comments" data-href="<?php echo (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; ?>" data-numposts="3" data-width="100%"></div>
</div>

 

...