WordPress.org

Ready to get started?Download WordPress

Forums

How to remove the comments form (6 posts)

  1. clyra
    Member
    Posted 1 year ago #

    I'd like to remove the comments form from a child of th Twenty Eleven theme.

    Any ideas, please?

  2. cdukes
    Member
    Posted 1 year ago #

    You could:
    -Disable commenting in Settings > Discussion
    -Disable commenting on a specific post in the editor
    -Hide the comment box with display: none
    -Or remove the comment hook from the single.php file

  3. Karun
    Member
    Posted 1 year ago #

    Copy the single.php and page.php file to your child theme and in single.php and page.php the is a line

    <?php comments_template( '', true ); ?>
    , remove it or comment it.

  4. clyra
    Member
    Posted 1 year ago #

    Thank you, Cooper. I'm more interested in removing the comments from the "pages" than the "posts". Can you tell me how do I hide the comment box with display:none?

  5. clyra
    Member
    Posted 1 year ago #

    Thanks, karunshakya45, but it didn't work for the pages, only for posts.

  6. clyra
    Member
    Posted 1 year ago #

    Got it. Removed the line from the sidebar-page.php (the template for all the pages)!

    Resolved.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.