author | ymh <ymh.work@gmail.com> |
Mon, 14 Oct 2019 18:30:03 +0200 | |
changeset 10 | 372f2766ea20 |
parent 7 | cf61fcea0001 |
permissions | -rw-r--r-- |
0 | 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_Thirteen |
|
9 |
* @since Twenty Thirteen 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 |
*/ |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
16 |
if ( post_password_required() ) { |
0 | 17 |
return; |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
18 |
} |
0 | 19 |
?> |
20 |
||
21 |
<div id="comments" class="comments-area"> |
|
22 |
||
23 |
<?php if ( have_comments() ) : ?> |
|
24 |
<h2 class="comments-title"> |
|
25 |
<?php |
|
10 | 26 |
if ( 1 === get_comments_number() ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
27 |
printf( |
10 | 28 |
/* translators: %s: The post title. */ |
29 |
_x( 'One thought on “%s”', 'comments title', 'twentythirteen' ), |
|
30 |
'<span>' . get_the_title() . '</span>' |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
31 |
); |
10 | 32 |
} else { |
33 |
printf( |
|
34 |
/* translators: %1$s: The number of comments. %2$s: The post title. */ |
|
35 |
_nx( '%1$s thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'comments title', 'twentythirteen' ), |
|
36 |
number_format_i18n( get_comments_number() ), |
|
37 |
'<span>' . get_the_title() . '</span>' |
|
38 |
); |
|
39 |
} |
|
0 | 40 |
?> |
41 |
</h2> |
|
42 |
||
43 |
<ol class="comment-list"> |
|
44 |
<?php |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
45 |
wp_list_comments( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
46 |
array( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
47 |
'style' => 'ol', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
48 |
'short_ping' => true, |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
49 |
'avatar_size' => 74, |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
50 |
) |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
51 |
); |
0 | 52 |
?> |
53 |
</ol><!-- .comment-list --> |
|
54 |
||
55 |
<?php |
|
56 |
// Are there comments to navigate through? |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
57 |
if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : |
10 | 58 |
?> |
0 | 59 |
<nav class="navigation comment-navigation" role="navigation"> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
60 |
<h1 class="screen-reader-text section-heading"><?php _e( 'Comment navigation', 'twentythirteen' ); ?></h1> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
61 |
<div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'twentythirteen' ) ); ?></div> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
62 |
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'twentythirteen' ) ); ?></div> |
0 | 63 |
</nav><!-- .comment-navigation --> |
64 |
<?php endif; // Check for comment navigation ?> |
|
65 |
||
66 |
<?php if ( ! comments_open() && get_comments_number() ) : ?> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
67 |
<p class="no-comments"><?php _e( 'Comments are closed.', 'twentythirteen' ); ?></p> |
0 | 68 |
<?php endif; ?> |
69 |
||
70 |
<?php endif; // have_comments() ?> |
|
71 |
||
72 |
<?php comment_form(); ?> |
|
73 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
74 |
</div><!-- #comments --> |