| 1 | <?php |
|---|
| 2 | |
|---|
| 3 | /** |
|---|
| 4 | * The template for displaying comments. |
|---|
| 5 | * |
|---|
| 6 | * This is the template that displays the area of the page that contains both the current comments |
|---|
| 7 | * and the comment form. |
|---|
| 8 | * |
|---|
| 9 | * @package NewseBlog |
|---|
| 10 | */ |
|---|
| 11 | /* |
|---|
| 12 | * If the current post is protected by a password and |
|---|
| 13 | * the visitor has not yet entered the password we will |
|---|
| 14 | * return early without loading the comments. |
|---|
| 15 | */ |
|---|
| 16 | if (post_password_required()) { |
|---|
| 17 | return; |
|---|
| 18 | } |
|---|
| 19 | ?> |
|---|
| 20 | <div id="comments" class="comments-area mg-card-box padding-20"> |
|---|
| 21 | |
|---|
| 22 | <?php |
|---|
| 23 | // You can start editing here -- including this comment! |
|---|
| 24 | if (have_comments()) : ?> |
|---|
| 25 | <div class="mg-heading-bor-bt"> |
|---|
| 26 | <h5 class="comments-title"> |
|---|
| 27 | <?php |
|---|
| 28 | $comments_number = get_comments_number(); |
|---|
| 29 | if ('1' === $comments_number) { |
|---|
| 30 | /* translators: %s: post title */ |
|---|
| 31 | printf(esc_html__('One thought on “%s”', 'newseblog'), esc_html(get_the_title())); |
|---|
| 32 | } else { |
|---|
| 33 | printf( |
|---|
| 34 | esc_html( |
|---|
| 35 | /* translators: 1: number of comments, 2: post title */ |
|---|
| 36 | _nx( |
|---|
| 37 | '%1$s thought on “%2$s”', |
|---|
| 38 | '%1$s thoughts on “%2$s”', |
|---|
| 39 | $comments_number, |
|---|
| 40 | 'comments title', |
|---|
| 41 | 'newseblog' |
|---|
| 42 | ) |
|---|
| 43 | ), |
|---|
| 44 | esc_html(number_format_i18n($comments_number)), |
|---|
| 45 | esc_html(get_the_title()) |
|---|
| 46 | ); |
|---|
| 47 | } |
|---|
| 48 | ?> |
|---|
| 49 | </h5> |
|---|
| 50 | </div> |
|---|
| 51 | |
|---|
| 52 | <?php if (get_comment_pages_count() > 1 && get_option('page_comments')) : // Are there comments to navigate through? |
|---|
| 53 | ?> |
|---|
| 54 | <nav id="comment-nav-above" class="navigation comment-navigation" role="navigation"> |
|---|
| 55 | <h2 class="screen-reader-text"><?php esc_html_e('Comment navigation', 'newseblog'); ?></h2> |
|---|
| 56 | <div class="nav-links"> |
|---|
| 57 | |
|---|
| 58 | <div class="nav-previous"><?php previous_comments_link(esc_html__('Older Comments', 'newseblog')); ?></div> |
|---|
| 59 | <div class="nav-next"><?php next_comments_link(esc_html__('Newer Comments', 'newseblog')); ?></div> |
|---|
| 60 | |
|---|
| 61 | </div><!-- .nav-links --> |
|---|
| 62 | </nav><!-- #comment-nav-above --> |
|---|
| 63 | <?php endif; // Check for comment navigation. |
|---|
| 64 | ?> |
|---|
| 65 | |
|---|
| 66 | <ol class="comment-list"> |
|---|
| 67 | <?php |
|---|
| 68 | wp_list_comments(array( |
|---|
| 69 | 'style' => 'ol', |
|---|
| 70 | 'newseblog_ping' => true, |
|---|
| 71 | 'avatar_size' => 50, |
|---|
| 72 | )); |
|---|
| 73 | ?> |
|---|
| 74 | </ol><!-- .comment-list --> |
|---|
| 75 | |
|---|
| 76 | <?php if (get_comment_pages_count() > 1 && get_option('page_comments')) : // Are there comments to navigate through? |
|---|
| 77 | ?> |
|---|
| 78 | <nav id="comment-nav-below" class="navigation comment-navigation" role="navigation"> |
|---|
| 79 | <h5 class="screen-reader-text"><?php esc_html_e('Comment navigation', 'newseblog'); ?></h5> |
|---|
| 80 | <div class="nav-links"> |
|---|
| 81 | |
|---|
| 82 | <div class="nav-previous"><?php previous_comments_link(esc_html__('Older Comments', 'newseblog')); ?></div> |
|---|
| 83 | <div class="nav-next"><?php next_comments_link(esc_html__('Newer Comments', 'newseblog')); ?></div> |
|---|
| 84 | |
|---|
| 85 | </div><!-- .nav-links --> |
|---|
| 86 | </nav><!-- #comment-nav-below --> |
|---|
| 87 | <?php |
|---|
| 88 | |
|---|
| 89 | endif; // Check for comment navigation. |
|---|
| 90 | endif; // Check for have_comments(). |
|---|
| 91 | |
|---|
| 92 | if (!comments_open() && get_comments_number() && post_type_supports(get_post_type(), 'comments')) : ?> |
|---|
| 93 | |
|---|
| 94 | <p class="no-comments"><?php esc_html_e('Comments are closed.', 'newseblog'); ?></p> |
|---|
| 95 | <?php |
|---|
| 96 | endif; |
|---|
| 97 | |
|---|
| 98 | comment_form(); |
|---|
| 99 | ?> |
|---|
| 100 | </div><!-- #comments --> |
|---|