author | ymh <ymh.work@gmail.com> |
Mon, 14 Oct 2019 17:39:30 +0200 | |
changeset 7 | cf61fcea0001 |
parent 5 | 5e2f62d02dcd |
permissions | -rw-r--r-- |
5 | 1 |
<?php |
2 |
/** |
|
3 |
* The template for displaying comments |
|
4 |
* |
|
5 |
* The area of the page that contains both current comments |
|
6 |
* and the comment form. |
|
7 |
* |
|
8 |
* @package WordPress |
|
9 |
* @subpackage Twenty_Fifteen |
|
10 |
* @since Twenty Fifteen 1.0 |
|
11 |
*/ |
|
12 |
||
13 |
/* |
|
14 |
* If the current post is protected by a password and |
|
15 |
* the visitor has not yet entered the password we will |
|
16 |
* return early without loading the comments. |
|
17 |
*/ |
|
18 |
if ( post_password_required() ) { |
|
19 |
return; |
|
20 |
} |
|
21 |
?> |
|
22 |
||
23 |
<div id="comments" class="comments-area"> |
|
24 |
||
25 |
<?php if ( have_comments() ) : ?> |
|
26 |
<h2 class="comments-title"> |
|
27 |
<?php |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
28 |
$comments_number = get_comments_number(); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
29 |
if ( '1' === $comments_number ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
30 |
/* translators: %s: post title */ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
31 |
printf( _x( 'One thought on “%s”', 'comments title', 'twentyfifteen' ), get_the_title() ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
32 |
} else { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
33 |
printf( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
34 |
/* translators: 1: number of comments, 2: post title */ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
35 |
_nx( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
36 |
'%1$s thought on “%2$s”', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
37 |
'%1$s thoughts on “%2$s”', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
38 |
$comments_number, |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
39 |
'comments title', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
40 |
'twentyfifteen' |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
41 |
), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
42 |
number_format_i18n( $comments_number ), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
43 |
get_the_title() |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
44 |
); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
45 |
} |
5 | 46 |
?> |
47 |
</h2> |
|
48 |
||
49 |
<?php twentyfifteen_comment_nav(); ?> |
|
50 |
||
51 |
<ol class="comment-list"> |
|
52 |
<?php |
|
53 |
wp_list_comments( array( |
|
54 |
'style' => 'ol', |
|
55 |
'short_ping' => true, |
|
56 |
'avatar_size' => 56, |
|
57 |
) ); |
|
58 |
?> |
|
59 |
</ol><!-- .comment-list --> |
|
60 |
||
61 |
<?php twentyfifteen_comment_nav(); ?> |
|
62 |
||
63 |
<?php endif; // have_comments() ?> |
|
64 |
||
65 |
<?php |
|
66 |
// If comments are closed and there are comments, let's leave a little note, shall we? |
|
67 |
if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : |
|
68 |
?> |
|
69 |
<p class="no-comments"><?php _e( 'Comments are closed.', 'twentyfifteen' ); ?></p> |
|
70 |
<?php endif; ?> |
|
71 |
||
72 |
<?php comment_form(); ?> |
|
73 |
||
74 |
</div><!-- .comments-area --> |