WordPress.org

Ready to get started?Download WordPress

Forums

Remove "Comments" text (5 posts)

  1. pattip
    Member
    Posted 4 years ago #

    How would you go about removing the text "comments are closed" from a WordPress ready to use page?

    Thanks!

  2. esmi
    Forum Moderator
    Posted 4 years ago #

    You could try editing the relevant template file and, where you see:

    <?php comments_popup_link([...]); ?>

    add <?php if('open' == $post->comment_status) : ?> immediately before this tag and <?php endif;?> immediately after. The whole thing should then look like:

    <?php if('open' == $post->comment_status) : ?><?php comments_popup_link([...]); ?><?php endif;?>

  3. pattip
    Member
    Posted 4 years ago #

    I am probably looking in the wrong place, but I am unable to find that particular line.

  4. pattip
    Member
    Posted 4 years ago #

    This is the closest I could find. Can anyone help? Thanks!

    <?php else : // this is displayed if there are no comments so far ?>

    <?php if ('open' == $post->comment_status) : ?>
    <!-- If comments are open, but there are no comments. -->

    <?php else : // comments are closed ?>
    <!-- If comments are closed. -->
    <p class="nocomments"><?php _e('Comments are closed','panorama') ; ?></p>

    <?php endif; ?>
    <?php endif; ?>

  5. esmi
    Forum Moderator
    Posted 4 years ago #

    Try removing:

    <?php else : // comments are closed ?>
    <!-- If comments are closed. -->
    <p class="nocomments"><?php _e('Comments are closed','panorama') ; ?></p>

Topic Closed

This topic has been closed to new replies.

About this Topic