Support » Theme: Hexa » Surpress comments on pages

  • Resolved evanarsdall

    (@evanarsdall)


    Hi All,

    I’m loving the Hexa theme except for one thing: I want to remove comments and text fields from pages (not posts – just pages). I’ve found some other WordPress threads that gave general instructions for suppressing page options, but I haven’t succeeded in getting them to work with Hexa.

    Here are the main techniques I’ve tried:

    • Unchecked the Discussion and Comments attributes for all pages.
    • Commented out the following code in page.php:
      <?php get_template_part( 'content', 'page' ); ?>
      
      	<?php
      	// If comments are open or we have at least one comment, load up the comment template
      	if ( comments_open() || '0' != get_comments_number() ) :
      						comments_template();
      					endif;
      	?>

    A recent visitor added political comments to my Experience page. I responded out of courtesy, but I would rather have had the conversation following a post.

    If anyone has any advice, please share it.

    Thanks,
    Eddie

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hey there Eddie,

    Hope you’re well today!

    This should be possible with some custom CSS. Could you please try adding the following CSS code in the style.css file of your child theme or add it in your site using the following plugin:

    http://wordpress.org/plugins/simple-custom-css

    .page div#comments {
    display: none;
    }

    This should remove comments area only on your pages and not on posts. If this doesn’t work could you please post link to your site so I can take a look?

    Hope this helps 🙂

    Best regards,
    Bojan

    Hi Bojan,

    Thank you for your help. I added the plug-in first, but the comment boxes still persist on all pages. I then tried adding the suggested code to the built-in style sheet, and it had no effect. Comments boxes are still visible on all pages.

    Again, I’m want to keep comment boxes and “Leave a reply” on posts, but I want to remove them from all pages.

    In case anyone responds, I’ll be out for a while but checking in later.

    Eddie

    Oops, one more thing. I don’t understand exactly how to use the plug-in. I’ve looked at the screen captures, but I’m not seeing an administration screen anywhere, nor do I know how to get to it.

    I simply added your recommended code to the end of my regular stylesheet.

    Eddie

    Moderator Kathryn

    (@zoonini)

    Automattic Happiness Engineer

    I tested Bojan’s CSS in my browser inspector and it worked to hide comments on pages.

    Once you activate the plugin, you’ll see a new item in your dashboard menu under Appearance > Custom CSS.

    It’s in this new CSS editor where you should add the CSS Bojan provided (thanks, Bojan!), like this:

    Simple Custom CSS Fictive 1 1 by Automattic WordPress

    As an alternative to just hiding the comment box, you could actually fully close comments on your pages, by unchecking the checkboxes in the Discussion area on all your pages. That would fully remove (not just hide) the comment form on pages. You can also delete any existing comments on pages as well, so that neither the form nor existing comments will be displayed.

    Here’s a guide to turning off comments on a page-by-page basis:

    https://en.support.wordpress.com/enable-disable-comments/

    Let me know how it goes!

    Hi Kathryn,

    As I indicated in my last post, I cannot figure out how to use the plug-in. I have obviously activated it, as its status is “Deactivate.” But for whatever reason, my Dashboard does not show anything related to the plugin. I have no idea how to access its editor, and I can’t find any way to troubleshoot the problem.

    Eddie

    Never mind! I finally noticed that the plugin added a command to the Appearance menu. I added the code and the comment fields are gone. Thank you, Bojan and Kathryn.

    Glad you managed to find it and that this is working for you 🙂

    Cheers,
    Bojan

    Moderator Kathryn

    (@zoonini)

    Automattic Happiness Engineer

    Glad you figured it out and go it all working!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Surpress comments on pages’ is closed to new replies.