Twenty Twelve: better fix for #20469 and comments closed messages, also load the comments template in single.php template regardless of whether comments are open or closed (consistent with page.php). Both props kovshenin.

git-svn-id: http://core.svn.wordpress.org/trunk@22615 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Lance Willett 2012-11-16 21:28:47 +00:00
parent ca3c50bd64
commit 1639521c3d
2 changed files with 2 additions and 6 deletions

View File

@ -49,7 +49,7 @@ if ( post_password_required() )
/* 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_open() && get_comments_number() ) : ?>
<!-- If comments are closed. -->
<p class="nocomments"><?php _e( 'Comments are closed.' , 'twentytwelve' ); ?></p>
<?php endif; ?>

View File

@ -22,11 +22,7 @@ get_header(); ?>
<span class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '&rarr;', 'Next post link', 'twentytwelve' ) . '</span>' ); ?></span>
</nav><!-- .nav-single -->
<?php
// If comments are open or we have at least one comment, load up the comment template
if ( comments_open() || '0' != get_comments_number() )
comments_template( '', true );
?>
<?php comments_template( '', true ); ?>
<?php endwhile; // end of the loop. ?>