wp/wp-content/themes/twentytwelve/comments.php
changeset 7 cf61fcea0001
parent 0 d970ebf37754
equal deleted inserted replaced
6:490d5cc509ed 7:cf61fcea0001
    15 /*
    15 /*
    16  * If the current post is protected by a password and
    16  * If the current post is protected by a password and
    17  * the visitor has not yet entered the password we will
    17  * the visitor has not yet entered the password we will
    18  * return early without loading the comments.
    18  * return early without loading the comments.
    19  */
    19  */
    20 if ( post_password_required() )
    20 if ( post_password_required() ) {
    21 	return;
    21 	return;
       
    22 }
    22 ?>
    23 ?>
    23 
    24 
    24 <div id="comments" class="comments-area">
    25 <div id="comments" class="comments-area">
    25 
    26 
    26 	<?php // You can start editing here -- including this comment! ?>
    27 	<?php // You can start editing here -- including this comment! ?>
    27 
    28 
    28 	<?php if ( have_comments() ) : ?>
    29 	<?php if ( have_comments() ) : ?>
    29 		<h2 class="comments-title">
    30 		<h2 class="comments-title">
    30 			<?php
    31 			<?php
    31 				printf( _n( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'twentytwelve' ),
    32 				printf(
    32 					number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' );
    33 					_n( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'twentytwelve' ),
       
    34 					number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>'
       
    35 				);
    33 			?>
    36 			?>
    34 		</h2>
    37 		</h2>
    35 
    38 
    36 		<ol class="commentlist">
    39 		<ol class="commentlist">
    37 			<?php wp_list_comments( array( 'callback' => 'twentytwelve_comment', 'style' => 'ol' ) ); ?>
    40 			<?php
       
    41 			wp_list_comments(
       
    42 				array(
       
    43 					'callback' => 'twentytwelve_comment',
       
    44 					'style'    => 'ol',
       
    45 				)
       
    46 			);
       
    47 ?>
    38 		</ol><!-- .commentlist -->
    48 		</ol><!-- .commentlist -->
    39 
    49 
    40 		<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
    50 		<?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">
    51 		<nav id="comment-nav-below" class="navigation" role="navigation">
    42 			<h1 class="assistive-text section-heading"><?php _e( 'Comment navigation', 'twentytwelve' ); ?></h1>
    52 			<h1 class="assistive-text section-heading"><?php _e( 'Comment navigation', 'twentytwelve' ); ?></h1>
    47 
    57 
    48 		<?php
    58 		<?php
    49 		/* If there are no comments and comments are closed, let's leave a note.
    59 		/* 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.
    60 		 * But we only want the note on posts and pages that had comments in the first place.
    51 		 */
    61 		 */
    52 		if ( ! comments_open() && get_comments_number() ) : ?>
    62 		if ( ! comments_open() && get_comments_number() ) :
    53 		<p class="nocomments"><?php _e( 'Comments are closed.' , 'twentytwelve' ); ?></p>
    63 		?>
       
    64 		<p class="nocomments"><?php _e( 'Comments are closed.', 'twentytwelve' ); ?></p>
    54 		<?php endif; ?>
    65 		<?php endif; ?>
    55 
    66 
    56 	<?php endif; // have_comments() ?>
    67 	<?php endif; // have_comments() ?>
    57 
    68 
    58 	<?php comment_form(); ?>
    69 	<?php comment_form(); ?>