Make WordPress Core


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

Twenty Eleven: better closed comments notes. Check only for "comment" type comments when deciding whether to show the message. Props iandstewart and obenland, closes #20469.

File:
1 edited

Legend:

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

    r18276 r22588  
    6464                <?php endif; // check for comment navigation ?>
    6565
    66         <?php
     66                <?php
    6767                /* If there are no comments and comments are closed, let's leave a little note, shall we?
    68                  * But we don't want the note on pages or post types that do not support comments.
     68                 * But we only want the note on posts and pages that had comments in the first place.
    6969                 */
    70                 elseif ( ! comments_open() && ! is_page() && post_type_supports( get_post_type(), 'comments' ) ) :
    71         ?>
    72                 <p class="nocomments"><?php _e( 'Comments are closed.', 'twentyeleven' ); ?></p>
    73         <?php endif; ?>
     70                if ( ! comments_open() && ! empty( $comments_by_type['comment'] ) ) : ?>
     71                <p class="nocomments"><?php _e( 'Comments are closed.' , 'twentyeleven' ); ?></p>
     72                <?php endif; ?>
     73
     74        <?php endif; // have_comments() ?>
    7475
    7576        <?php comment_form(); ?>
Note: See TracChangeset for help on using the changeset viewer.