Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #209049

    Hi,

    If I want to use facebook’s social media plug in that puts a comment box on my blog pages [of the site http://www.indiatrail.org] – how do I do that?

    I have generated the code using facebook’s developer page and that’s ready. That asks me to insert that in to the page where I want the comments – not sure how to do that.

    I’ve seen that you ask people to remove the following code from the Single.php page – can I just replace that text with the facebook code?

    //wordpress function that loads the comments template “comments.php”
    comments_template( ‘/includes/comments.php’);

    Thanks again!

    Rohan

    #209075

    Hey Rohan!

    What is the facebook plugin that you use? Do the plugin use shortcodes? You can replace the comments code on single.php.

    Regards,
    Ismael

    #209076

    Hi Ismael,

    I have two options:

    1. Include the JavaScript SDK on your page once, ideally right after the opening <body> tag.
    <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_GB/all.js#xfbml=1&appId=526220487494071″;
    fjs.parentNode.insertBefore(js, fjs);
    }(document, ‘script’, ‘facebook-jssdk’));</script>

    and
    2. Place the code for your plugin wherever you want the plugin to appear on your page.
    <div class=”fb-comments” data-href=”http://www.indiatrail.org/blog/&#8221; data-numposts=”5″ data-colorscheme=”light”></div>

    Which one shall I paste there?

    Rohan

    #209086

    Hey!

    Edit header.php, find this code on line 117:

    <body id="top" <?php body_class($style." ".$avia_config['font_stack']); ?>>

    Below, add this code:

    <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_GB/all.js#xfbml=1&appId=526220487494071";
    fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));</script>

    Edit single.php, find this code:

    //wordpress function that loads the comments template "comments.php"
    					comments_template( '/includes/comments.php'); 

    Replace it with:

    echo '<div class="fb-comments" data-href="http://www.indiatrail.org/blog/" data-numposts="5" data-colorscheme="light"></div>';

    Best regards,
    Ismael

    #209089

    Thanks Ismael,

    However I can’t seem to find that line in the header.php file. The closest is:

    <body id=”top” <?php body_class($style.” “.$avia_config[‘font_stack’].” “.$blank); avia_markup_helper(array(‘context’ => ‘body’)); ?>>

    Do I paste it under that one?

    Rohan

    #209261

    Hi Rohan!

    Yes, after the body tag should do it.

    Cheers!
    Josue

    #238763

    Guys, I haven’t been able to figure out how to add a comments box after a post where the user can log in with his/ her facebook account and post comments.

    #239809

    Hey Rohan!

    Try this plugin:
    http://wordpress.org/plugins/facebook-comments-plugin/

    Regards,
    Josue

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Facebook Comment Box’ is closed to new replies.