Support » Themes and Templates » Using the is_page() condition in comment file

  • 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

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Using the is_page() condition in comment file’ is closed to new replies.