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.

git-svn-id: https://develop.svn.wordpress.org/trunk@22588 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Lance Willett 2012-11-15 00:48:03 +00:00
parent 05d7baa79a
commit 43107f767c
1 changed files with 7 additions and 6 deletions

View File

@ -63,14 +63,15 @@
</nav>
<?php endif; // check for comment navigation ?>
<?php
<?php
/* If there are no comments and comments are closed, let's leave a little note, shall we?
* But we don't want the note on pages or post types that do not support comments.
* But we only want the note on posts and pages that had comments in the first place.
*/
elseif ( ! comments_open() && ! is_page() && post_type_supports( get_post_type(), 'comments' ) ) :
?>
<p class="nocomments"><?php _e( 'Comments are closed.', 'twentyeleven' ); ?></p>
<?php endif; ?>
if ( ! comments_open() && ! empty( $comments_by_type['comment'] ) ) : ?>
<p class="nocomments"><?php _e( 'Comments are closed.' , 'twentyeleven' ); ?></p>
<?php endif; ?>
<?php endif; // have_comments() ?>
<?php comment_form(); ?>