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 twentyeleven_comment() which is
8 * located in the functions.php file.
11 * @subpackage Twenty_Eleven
12 * @since Twenty Eleven 1.0
16 <?php if ( post_password_required() ) : ?>
17 <p class="nopassword"><?php _e( 'This post is password protected. Enter the password to view any comments.', 'twentyeleven' ); ?></p>
18 </div><!-- #comments -->
20 /* Stop the rest of comments.php from being processed,
21 * but don't kill the script entirely -- we still have
22 * to fully load the template.
28 <?php // You can start editing here -- including this comment! ?>
30 <?php if ( have_comments() ) : ?>
31 <h2 id="comments-title">
33 printf( _n( 'One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'twentyeleven' ),
34 number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' );
38 <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
39 <nav id="comment-nav-above">
40 <h1 class="assistive-text"><?php _e( 'Comment navigation', 'twentyeleven' ); ?></h1>
41 <div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'twentyeleven' ) ); ?></div>
42 <div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'twentyeleven' ) ); ?></div>
44 <?php endif; // check for comment navigation ?>
46 <ol class="commentlist">
48 /* Loop through and list the comments. Tell wp_list_comments()
49 * to use twentyeleven_comment() to format the comments.
50 * If you want to overload this in a child theme then you can
51 * define twentyeleven_comment() and that will be used instead.
52 * See twentyeleven_comment() in twentyeleven/functions.php for more.
54 wp_list_comments( array( 'callback' => 'twentyeleven_comment' ) );
58 <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
59 <nav id="comment-nav-below">
60 <h1 class="assistive-text"><?php _e( 'Comment navigation', 'twentyeleven' ); ?></h1>
61 <div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'twentyeleven' ) ); ?></div>
62 <div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'twentyeleven' ) ); ?></div>
64 <?php endif; // check for comment navigation ?>
67 /* If there are no comments and comments are closed, let's leave a little note, shall we?
68 * But we only want the note on posts and pages that had comments in the first place.
70 if ( ! comments_open() && get_comments_number() ) : ?>
71 <p class="nocomments"><?php _e( 'Comments are closed.' , 'twentyeleven' ); ?></p>
74 <?php endif; // have_comments() ?>
76 <?php comment_form(); ?>
78 </div><!-- #comments -->