WordPress.org

Ready to get started?Download WordPress

Forums

Using the is_page() condition in comment file (2 posts)

  1. marzar00
    Member
    Posted 6 years ago #

    G'day all,

    I am trying to use the code below in my comments.php file to output nothing on a page when comments are closed, and 'Comments are closed' on posts when comments are closed.

    <?php if(is_page()) : ?>
          <!-- Is a page so show nothing -->
     <?php else : ?>
          <p class="nocomments">Comments are closed.</p>
     <?php  endif; ?>

    Any help is much appreciated

  2. marzar00
    Member
    Posted 6 years ago #

    Anyone?

Topic Closed

This topic has been closed to new replies.

About this Topic