Make WordPress Core


Ignore:
Timestamp:
11/15/2012 12:43:43 AM (14 years ago)
Author:
lancewillett
Message:

Twenty Twelve: better closed comments notes. Check only for "comment" type comments when deciding whether to show the message.

File:
1 edited

Legend:

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

    r22318 r22587  
    4646                <?php endif; // check for comment navigation ?>
    4747
    48         <?php // If comments are closed and there are comments, let's leave a little note.
    49                 elseif ( ! comments_open() && '0' != get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
    50         ?>
    51                 <p class="nocomments"><?php _e( 'Comments are closed.', 'twentytwelve' ); ?></p>
    52         <?php endif; ?>
     48                <?php
     49                /* If there are no comments and comments are closed, let's leave a note.
     50                 * But we only want the note on posts and pages that had comments in the first place.
     51                 */
     52                if ( ! comments_open() && ! empty( $comments_by_type['comment'] ) ) : ?>
     53                <!-- If comments are closed. -->
     54                <p class="nocomments"><?php _e( 'Comments are closed.' , 'twentytwelve' ); ?></p>
     55                <?php endif; ?>
     56
     57        <?php endif; // have_comments() ?>
    5358
    5459        <?php comment_form(); ?>
Note: See TracChangeset for help on using the changeset viewer.