Search code examples
commentsfacebook-social-pluginsfacebook-comments

Facebook Comments: Different comments on different pages


I have a static site. Facebook comment "thanks" on page1.php is also visible at all pages i.e. page2.php, page3.php etc. I have FB application API. How can I set the comment "thanks" for page1.php only not for the all pages? I am not much technical, referring to a tutorial will be highly appreciated. Thanks & regards!


Solution

  • From https://developers.facebook.com/docs/reference/plugins/comments/, the url you use gets programmed into the plugin code you copy onto your site. You will need to hand modify the data-href for each page you paste it into.

    This would go on page 1

    <div class="fb-comments" data-href="http://example.com/page1.php" data-num-posts="2" data-width="500"></div>
    

    This would go on page 2

    <div class="fb-comments" data-href="http://example.com/page2.php" data-num-posts="2" data-width="500"></div>
    

    etc...