WordPress.org

Forums

Facebook Comments
[closed] Hide Comments box in some pages/posts using ID (7 posts)

  1. gonix
    Member
    Posted 2 years ago #

    Is it possible to hide the comments box in some pages indicated by each page/post ID?

    I searched and I come up with this:

    add in header.php:

    <body <?php body_class(); ?>>

    and this in css:

    .page-id-1462 .fb_iframe_widget {
      display:none;
    }

    but it doesnt work so I try:

    .page-id-1545 .fbFeedbackContent {
      display:none;
    }

    but still didn't work.

    Can anyone point me in the right direction?

    Thanks!
    - Gon

    http://wordpress.org/extend/plugins/facebook-comments-plugin/

  2. littlethoughts
    Member
    Posted 2 years ago #

    This isn't a very convenient way to deal with elements you don't want to appear. For pages you can use this php code in the php file(s) where you want the comments to disappear:

    if (!is_single(array(123,345,456))) {echo do_shortcode('[fbcomments]');}

    Replace the IDs 123,345,456 with the ones that you want to hide.

    For posts use:

    if (is_single(array(123,345,456))) {echo do_shortcode('[fbcomments]');}

    Hope that helps!

  3. gonix
    Member
    Posted 2 years ago #

    I have tried that as well but it doesnt work. Maybe there is something wrong with my theme. I fixed the issue by using another plugin instead. Thank you for your suggestion.

  4. lucasrubini
    Member
    Posted 2 years ago #

    Hey gonix, what plugin did you use to fix that? I have the same problem!

  5. gonix
    Member
    Posted 2 years ago #

    lucasrubini.. i forgot :( i think i disabled the comment box in this plugin and use another facebook plugin which can hide comments in pages.

  6. Tony Franco
    Member
    Posted 1 year ago #

    Dear Sirs,

    Nice post... i have the same doubt...

    Please, i want to remove the fb comments of a single post, this for example:

    http://www.obrasdarte.com/venda/

    What code i have to put to remove at this post?

    Thanks and Regards,

    Tony

  7. esmi
    Forum Moderator
    Posted 1 year ago #

    @Tony Franco: If you require assistance then, as per the Forum Welcome, please post your own topic.

    This 11 month old topic references an old version of WordPress.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Facebook Comments
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic