Make WordPress Core

Changeset 22617


Ignore:
Timestamp:
11/16/2012 09:35:42 PM (12 years ago)
Author:
lancewillett
Message:

Twenty Ten: move the "Comments closed" text outside the have_comments() conditional, props kovshenin. Closes #20469.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/twentyten/comments.php

    r19599 r22617  
    6363<?php endif; // check for comment navigation ?>
    6464
    65 <?php else : // or, if we don't have comments:
    66 
    67     /* If there are no comments and comments are closed,
    68      * let's leave a little note, shall we?
    69      */
    70     if ( ! comments_open() ) :
    71 ?>
    72     <p class="nocomments"><?php _e( 'Comments are closed.', 'twentyten' ); ?></p>
    73 <?php endif; // end ! comments_open() ?>
     65<?php
     66/* If there are no comments and comments are closed, let's leave a little note, shall we?
     67 * But we only want the note on posts and pages that had comments in the first place.
     68 */
     69if ( ! comments_open() && get_comments_number() ) : ?>
     70    <p class="nocomments"><?php _e( 'Comments are closed.' , 'twentyten' ); ?></p>
     71<?php endif; // end ! comments_open ?>
    7472
    7573<?php endif; // end have_comments() ?>
Note: See TracChangeset for help on using the changeset viewer.