Search code examples
facebook-comments

Facebook comments plugin not loading


I'm using Facebook comments Plugin on one of my page (WordPress Driven) and it was working but suddenly it stopped loading. I didn't change anything and I can see those codes present at the page. It happened several times, sometimes work and suddenly stops. I've added xml name space at the html tag and placed the code right after body opening tag, at first the root div and then js. Can anyone please check it out at http://heera.it/who and it's at the bottom of the page. Thanks !


Solution

  • Try without using a plugin. Just make your own.

    Find this line: <?php comments_template(); ?> in the file (in theme) you want to add a comment facebook. (exm. wp-content -> themes -> YourTheme -> single.php)

    Copy and paste the following code above the line above:

        <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/all.js#xfbml=1";
        fjs.parentNode.insertBefore(js, fjs);
        }(document, 'script', 'facebook-jssdk'));</script>
    
    <div class="fb-comments" data-href="YOUR WEBSITE LINK" data-num-posts="2" data-width="628"></div>
    <?php comments_template(); ?>