|
5 | 5 | * This is the template that displays the area of the page that contains both the current comments |
6 | 6 | * and the comment form. |
7 | 7 | * |
8 | | - * @link https://codex.wordpress.org/Template_Hierarchy |
| 8 | + * @link https://codex.wordpress.org/Template_Hierarchy |
9 | 9 | * |
10 | 10 | * @package Shapely |
11 | 11 | */ |
|
21 | 21 | ?> |
22 | 22 |
|
23 | 23 | <div id="comments" class="comments-area comments nolist"> |
24 | | - <?php |
25 | | - // You can start editing here -- including this comment! |
26 | | - if ( have_comments() ) : ?> |
| 24 | + <?php if ( have_comments() ) : ?> |
27 | 25 | <h5 class="comments-title"> |
28 | | - <?php |
29 | | - $comments_number = get_comments_number(); |
30 | | - if ( '1' === $comments_number ) { |
31 | | - /* translators: %s: post title */ |
32 | | - echo _x( '1 COMMENT', 'comments title', 'shapely' ); |
33 | | - } else { |
34 | | - printf( |
35 | | - /* translators: number of comments */ |
36 | | - _nx( |
37 | | - '%1$s COMMENT', |
38 | | - '%1$s COMMENTS', |
39 | | - $comments_number, |
40 | | - 'comments title', |
41 | | - 'shapely' |
42 | | - ), |
43 | | - number_format_i18n( $comments_number ) |
44 | | - ); |
45 | | - } |
46 | | - ?> |
| 26 | + <?php |
| 27 | + $comments_number = get_comments_number(); |
| 28 | + if ( '1' === $comments_number ) { |
| 29 | + /* translators: %s: post title */ |
| 30 | + echo _x( '1 COMMENT', 'comments title', 'shapely' ); |
| 31 | + } else { |
| 32 | + printf( |
| 33 | + /* translators: number of comments */ |
| 34 | + _nx( |
| 35 | + '%1$s COMMENT', |
| 36 | + '%1$s COMMENTS', |
| 37 | + $comments_number, |
| 38 | + 'comments title', |
| 39 | + 'shapely' |
| 40 | + ), |
| 41 | + number_format_i18n( $comments_number ) |
| 42 | + ); |
| 43 | + } |
| 44 | + ?> |
47 | 45 | </h5> |
48 | 46 |
|
49 | | - <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?> |
50 | | - <nav id="comment-nav-above" class="navigation comment-navigation" role="navigation"> |
51 | | - <h2 class="screen-reader-text"><?php esc_html_e( 'Comment navigation', 'shapely' ); ?></h2> |
52 | | - <div class="nav-links"> |
| 47 | + <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?> |
| 48 | + <nav id="comment-nav-above" class="navigation comment-navigation" role="navigation"> |
| 49 | + <h2 class="screen-reader-text"><?php esc_html_e( 'Comment navigation', 'shapely' ); ?></h2> |
| 50 | + <div class="nav-links"> |
53 | 51 |
|
54 | | - <div class="nav-previous"><?php previous_comments_link( esc_html__( 'Older Comments', 'shapely' ) ); ?></div> |
55 | | - <div class="nav-next"><?php next_comments_link( esc_html__( 'Newer Comments', 'shapely' ) ); ?></div> |
| 52 | + <div class="nav-previous"><?php previous_comments_link( esc_html__( 'Older Comments', 'shapely' ) ); ?></div> |
| 53 | + <div class="nav-next"><?php next_comments_link( esc_html__( 'Newer Comments', 'shapely' ) ); ?></div> |
56 | 54 |
|
57 | | - </div><!-- .nav-links --> |
58 | | - </nav><!-- #comment-nav-above --> |
59 | | - <?php endif; // Check for comment navigation. ?> |
| 55 | + </div><!-- .nav-links --> |
| 56 | + </nav><!-- #comment-nav-above --> |
| 57 | + <?php endif; ?> |
60 | 58 |
|
61 | 59 | <?php add_filter( 'comment_reply_link', 'shapely_reply_link_class' ); ?> |
62 | 60 | <ul class="comments-list"> |
63 | 61 | <?php |
64 | | - wp_list_comments( array( |
65 | | - 'style' => 'ol', |
66 | | - 'short_ping' => true, |
| 62 | + wp_list_comments( |
| 63 | + array( |
| 64 | + 'style' => 'ol', |
| 65 | + 'short_ping' => true, |
67 | 66 | 'avatar_size' => 75, |
68 | | - 'callback' => 'shapely_cb_comment', |
69 | | - ) ); |
| 67 | + 'callback' => 'shapely_cb_comment', |
| 68 | + ) |
| 69 | + ); |
70 | 70 | ?> |
71 | 71 | </ul><!-- .comment-list --> |
72 | 72 | <?php remove_filter( 'comment_reply_link', 'shapely_reply_link_class' ); ?> |
73 | 73 |
|
74 | 74 |
|
75 | | - <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?> |
76 | | - <nav id="comment-nav-below" class="navigation comment-navigation" role="navigation"> |
77 | | - <h2 class="screen-reader-text"><?php esc_html_e( 'Comment navigation', 'shapely' ); ?></h2> |
78 | | - <div class="nav-links"> |
| 75 | + <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?> |
| 76 | + <nav id="comment-nav-below" class="navigation comment-navigation" role="navigation"> |
| 77 | + <h2 class="screen-reader-text"><?php esc_html_e( 'Comment navigation', 'shapely' ); ?></h2> |
| 78 | + <div class="nav-links"> |
79 | 79 |
|
80 | | - <div class="nav-previous"><?php previous_comments_link( esc_html__( 'Older Comments', 'shapely' ) ); ?></div> |
81 | | - <div class="nav-next"><?php next_comments_link( esc_html__( 'Newer Comments', 'shapely' ) ); ?></div> |
| 80 | + <div class="nav-previous"><?php previous_comments_link( esc_html__( 'Older Comments', 'shapely' ) ); ?></div> |
| 81 | + <div class="nav-next"><?php next_comments_link( esc_html__( 'Newer Comments', 'shapely' ) ); ?></div> |
82 | 82 |
|
83 | | - </div><!-- .nav-links --> |
84 | | - </nav><!-- #comment-nav-below --> |
85 | | - <?php |
| 83 | + </div><!-- .nav-links --> |
| 84 | + </nav><!-- #comment-nav-below --> |
| 85 | + <?php |
86 | 86 | endif; // Check for comment navigation. |
87 | 87 |
|
88 | 88 | endif; // Check for have_comments(). |
89 | 89 |
|
90 | 90 |
|
91 | 91 | // If comments are closed and there are comments, let's leave a little note, shall we? |
92 | | - if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : ?> |
| 92 | +if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : |
| 93 | +?> |
93 | 94 |
|
94 | 95 | <p class="no-comments"><?php esc_html_e( 'Comments are closed.', 'shapely' ); ?></p> |
95 | | - <?php |
| 96 | + <?php |
96 | 97 | endif; |
97 | 98 |
|
98 | 99 | /* comment form */ |
|
0 commit comments