| 1 | <?php |
|---|
| 2 | if ( post_password_required() ) { |
|---|
| 3 | return; |
|---|
| 4 | } |
|---|
| 5 | ?> |
|---|
| 6 | |
|---|
| 7 | <div id="comments" class="comments-area"> |
|---|
| 8 | <?php |
|---|
| 9 | // You can start editing here -- including this comment! |
|---|
| 10 | if ( have_comments() ) : ?> |
|---|
| 11 | <h2 class="comments-title"> |
|---|
| 12 | <?php |
|---|
| 13 | $movie_review_blog_comments_number = get_comments_number(); |
|---|
| 14 | if ( '1' === $movie_review_blog_comments_number ) { |
|---|
| 15 | /* translators: %s: post title */ |
|---|
| 16 | printf( esc_html__( 'One thought on “%s”', 'movie-review-blog' ), esc_html( get_the_title() ) ); |
|---|
| 17 | } else { |
|---|
| 18 | printf( |
|---|
| 19 | esc_html( |
|---|
| 20 | /* translators: 1: number of comments, 2: post title */ |
|---|
| 21 | _nx( |
|---|
| 22 | '%1$s thought on “%2$s”', |
|---|
| 23 | '%1$s thoughts on “%2$s”', |
|---|
| 24 | $movie_review_blog_comments_number, |
|---|
| 25 | 'comments title', |
|---|
| 26 | 'movie-review-blog' |
|---|
| 27 | ) |
|---|
| 28 | ), |
|---|
| 29 | esc_html( number_format_i18n( $movie_review_blog_comments_number ) ), |
|---|
| 30 | esc_html( get_the_title() ) |
|---|
| 31 | ); |
|---|
| 32 | } |
|---|
| 33 | ?> |
|---|
| 34 | </h2> |
|---|
| 35 | <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?> |
|---|
| 36 | <nav id="comment-nav-above" class="navigation comment-navigation" role="navigation"> |
|---|
| 37 | <h2 class="screen-reader-text"><?php esc_html_e( 'Comment navigation', 'movie-review-blog' ); ?></h2> |
|---|
| 38 | <div class="nav-links"> |
|---|
| 39 | <div class="nav-previous"><?php previous_comments_link( esc_html__( 'Older Comments', 'movie-review-blog' ) ); ?></div> |
|---|
| 40 | <div class="nav-next"><?php next_comments_link( esc_html__( 'Newer Comments', 'movie-review-blog' ) ); ?></div> |
|---|
| 41 | </div> |
|---|
| 42 | </nav> |
|---|
| 43 | <?php endif; // Check for comment navigation. ?> |
|---|
| 44 | <ul class="comment-list"> |
|---|
| 45 | <?php |
|---|
| 46 | wp_list_comments( array( 'callback' => 'movie_review_blog_comment', 'avatar_size' => 50 )); |
|---|
| 47 | ?> |
|---|
| 48 | </ul> |
|---|
| 49 | <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?> |
|---|
| 50 | <nav id="comment-nav-below" class="navigation comment-navigation" role="navigation"> |
|---|
| 51 | <h2 class="screen-reader-text"><?php esc_html_e( 'Comment navigation', 'movie-review-blog' ); ?></h2> |
|---|
| 52 | <div class="nav-links"> |
|---|
| 53 | <div class="nav-previous"><?php previous_comments_link( esc_html__( 'Older Comments', 'movie-review-blog' ) ); ?></div> |
|---|
| 54 | <div class="nav-next"><?php next_comments_link( esc_html__( 'Newer Comments', 'movie-review-blog' ) ); ?></div> |
|---|
| 55 | </div> |
|---|
| 56 | </nav> |
|---|
| 57 | <?php |
|---|
| 58 | endif; // Check for comment navigation. |
|---|
| 59 | |
|---|
| 60 | endif; // Check for have_comments(). |
|---|
| 61 | |
|---|
| 62 | // If comments are closed and there are comments, let's leave a little note, shall we? |
|---|
| 63 | if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : ?> |
|---|
| 64 | <p class="no-comments"><?php esc_html_e( 'Comments are closed.', 'movie-review-blog' ); ?></p> |
|---|
| 65 | <?php |
|---|
| 66 | endif; ?> |
|---|
| 67 | |
|---|
| 68 | <?php |
|---|
| 69 | comment_form( array( |
|---|
| 70 | 'title_reply_before' => '<h2 id="reply-title" class="comment-reply-title">', |
|---|
| 71 | 'title_reply_after' => '</h2>', |
|---|
| 72 | ) ); |
|---|
| 73 | ?> |
|---|
| 74 | </div> |
|---|