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

git-svn-id: http://core.svn.wordpress.org/trunk@22587 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Lance Willett 2012-11-15 00:43:43 +00:00
parent dc43ad3ac8
commit 29d5523b23
1 changed files with 10 additions and 5 deletions

View File

@ -45,12 +45,17 @@ if ( post_password_required() )
</nav>
<?php endif; // check for comment navigation ?>
<?php // If comments are closed and there are comments, let's leave a little note.
elseif ( ! comments_open() && '0' != get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
?>
<p class="nocomments"><?php _e( 'Comments are closed.', 'twentytwelve' ); ?></p>
<?php
/* If there are no comments and comments are closed, let's leave a note.
* But we only want the note on posts and pages that had comments in the first place.
*/
if ( ! comments_open() && ! empty( $comments_by_type['comment'] ) ) : ?>
<!-- If comments are closed. -->
<p class="nocomments"><?php _e( 'Comments are closed.' , 'twentytwelve' ); ?></p>
<?php endif; ?>
<?php endif; // have_comments() ?>
<?php comment_form(); ?>
</div><!-- #comments .comments-area -->