3 * The template for displaying Comments
5 * The area of the page that contains both current comments
6 * and the comment form. The actual display of comments is
7 * handled by a callback to twentytwelve_comment() which is
8 * located in the functions.php file.
11 * @subpackage Twenty_Twelve
12 * @since Twenty Twelve 1.0
16 * If the current post is protected by a password and
17 * the visitor has not yet entered the password we will
18 * return early without loading the comments.
20 if ( post_password_required() )
24 <div id="comments" class="comments-area">
26 <?php // You can start editing here -- including this comment! ?>
28 <?php if ( have_comments() ) : ?>
29 <h2 class="comments-title">
31 printf( _n( 'One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'twentytwelve' ),
32 number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' );
36 <ol class="commentlist">
37 <?php wp_list_comments( array( 'callback' => 'twentytwelve_comment', 'style' => 'ol' ) ); ?>
38 </ol><!-- .commentlist -->
40 <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
41 <nav id="comment-nav-below" class="navigation" role="navigation">
42 <h1 class="assistive-text section-heading"><?php _e( 'Comment navigation', 'twentytwelve' ); ?></h1>
43 <div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'twentytwelve' ) ); ?></div>
44 <div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'twentytwelve' ) ); ?></div>
46 <?php endif; // check for comment navigation ?>
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.
52 if ( ! comments_open() && get_comments_number() ) : ?>
53 <p class="nocomments"><?php _e( 'Comments are closed.' , 'twentytwelve' ); ?></p>
56 <?php endif; // have_comments() ?>
58 <?php comment_form(); ?>
60 </div><!-- #comments .comments-area -->