How to Integrate Facebook Comments Plugin in HTML

May 24, 2020
HTML/CSS
facebook comment plugin

Step 1:

Go to this website:  Facebook Developer Page

Step 2:

Go to Comments Plugin Code Generator.

Step 3:

Click Get Code button and fill-up the form.

facebook comments plugin

Step 4:

Copy the code and paste it to your php page.

Example Code:

<html>
<head>
    <meta charset="utf-8">
    <title>How to Integrate Facebook Comments Plugin</title>
    <link rel="stylesheet" type="text/css" href="bootstrap4/css/bootstrap.min.css">
</head>
<body>
<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 = 'https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.12';
    fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
 
<div class="container">
    <h1 class="text-center" style="margin-top:30px;">How to Integrate Facebook Comments Plugin</h1>
    <hr>
    <div class="row justify-content-center">
        <div class="col-sm-6">
            <div class="fb-comments" data-href="http://localhost/facebook_comment/index.html" data-numposts="10"></div>
        </div>
    </div>
</div>
</body>
</html>

Video Tutorial:

Facebook Comments

Leave a Reply

Your email address will not be published.