| 1 | <?php |
|---|
| 2 | /** |
|---|
| 3 | * The template for displaying Comments |
|---|
| 4 | * |
|---|
| 5 | * The area of the page that contains comments and the comment form. |
|---|
| 6 | * |
|---|
| 7 | * @package WordPress |
|---|
| 8 | * @subpackage Twenty_Fourteen |
|---|
| 9 | * @since Twenty Fourteen 1.0 |
|---|
| 10 | */ |
|---|
| 11 | |
|---|
| 12 | /* |
|---|
| 13 | * If the current post is protected by a password and the visitor has not yet |
|---|
| 14 | * entered the password we will return early without loading the comments. |
|---|
| 15 | */ |
|---|
| 16 | if ( post_password_required() ) { |
|---|
| 17 | return; |
|---|
| 18 | } |
|---|
| 19 | ?> |
|---|
| 20 | |
|---|
| 21 | <div id="comments" class="comments-area"> |
|---|
| 22 | |
|---|
| 23 | <?php if ( have_comments() ) : ?> |
|---|
| 24 | |
|---|
| 25 | <h2 class="comments-title"> |
|---|
| 26 | <?php |
|---|
| 27 | $comments_number = get_comments_number(); |
|---|
| 28 | if ( '1' === $comments_number ) { |
|---|
| 29 | /* translators: %s: post title */ |
|---|
| 30 | printf( _x( 'One thought on “%s”', 'comments title', 'twentyfourteen' ), get_the_title() ); |
|---|
| 31 | } else { |
|---|
| 32 | printf( |
|---|
| 33 | /* translators: 1: number of comments, 2: post title */ |
|---|
| 34 | _nx( |
|---|
| 35 | '%1$s thought on “%2$s”', |
|---|
| 36 | '%1$s thoughts on “%2$s”', |
|---|
| 37 | $comments_number, |
|---|
| 38 | 'comments title', |
|---|
| 39 | 'twentyfourteen' |
|---|
| 40 | ), |
|---|
| 41 | number_format_i18n( $comments_number ), |
|---|
| 42 | get_the_title() |
|---|
| 43 | ); |
|---|
| 44 | } |
|---|
| 45 | ?> |
|---|
| 46 | </h2> |
|---|
| 47 | |
|---|
| 48 | <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?> |
|---|
| 49 | <nav id="comment-nav-above" class="navigation comment-navigation" role="navigation"> |
|---|
| 50 | <h1 class="screen-reader-text"><?php _e( 'Comment navigation', 'twentyfourteen' ); ?></h1> |
|---|
| 51 | <div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'twentyfourteen' ) ); ?></div> |
|---|
| 52 | <div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'twentyfourteen' ) ); ?></div> |
|---|
| 53 | </nav><!-- #comment-nav-above --> |
|---|
| 54 | <?php endif; // Check for comment navigation. ?> |
|---|
| 55 | |
|---|
| 56 | <ol class="comment-list"> |
|---|
| 57 | <?php |
|---|
| 58 | wp_list_comments( |
|---|
| 59 | array( |
|---|
| 60 | 'style' => 'ol', |
|---|
| 61 | 'short_ping' => true, |
|---|
| 62 | 'avatar_size' => 34, |
|---|
| 63 | ) |
|---|
| 64 | ); |
|---|
| 65 | ?> |
|---|
| 66 | </ol><!-- .comment-list --> |
|---|
| 67 | |
|---|
| 68 | <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?> |
|---|
| 69 | <nav id="comment-nav-below" class="navigation comment-navigation" role="navigation"> |
|---|
| 70 | <h1 class="screen-reader-text"><?php _e( 'Comment navigation', 'twentyfourteen' ); ?></h1> |
|---|
| 71 | <div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'twentyfourteen' ) ); ?></div> |
|---|
| 72 | <div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'twentyfourteen' ) ); ?></div> |
|---|
| 73 | </nav><!-- #comment-nav-below --> |
|---|
| 74 | <?php endif; // Check for comment navigation. ?> |
|---|
| 75 | |
|---|
| 76 | <?php if ( ! comments_open() ) : ?> |
|---|
| 77 | <p class="no-comments"><?php _e( 'Comments are closed.', 'twentyfourteen' ); ?></p> |
|---|
| 78 | <?php endif; ?> |
|---|
| 79 | |
|---|
| 80 | <?php endif; // have_comments() ?> |
|---|
| 81 | |
|---|
| 82 | <?php comment_form(); ?> |
|---|
| 83 | |
|---|
| 84 | </div><!-- #comments --> |
|---|