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 comments and the comment form. |
|
6 |
* |
|
7 |
* @package WordPress |
|
8 |
* @subpackage Twenty_Fourteen |
|
9 |
* @since Twenty Fourteen 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 |
*/ |
|
16 |
if ( post_password_required() ) { |
|
17 |
return; |
|
18 |
} |
|
19 |
?> |
|
20 |
||
21 |
<div id="comments" class="comments-area"> |
|
22 |
||
23 |
<?php if ( have_comments() ) : ?> |
|
24 |
||
25 |
<h2 class="comments-title"> |
|
26 |
<?php |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
27 |
$comments_number = get_comments_number(); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
28 |
if ( '1' === $comments_number ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
29 |
/* translators: %s: post title */ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
30 |
printf( _x( 'One thought on “%s”', 'comments title', 'twentyfourteen' ), get_the_title() ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
31 |
} else { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
32 |
printf( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
33 |
/* translators: 1: number of comments, 2: post title */ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
34 |
_nx( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
35 |
'%1$s thought on “%2$s”', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
36 |
'%1$s thoughts on “%2$s”', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
37 |
$comments_number, |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
38 |
'comments title', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
39 |
'twentyfourteen' |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
40 |
), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
41 |
number_format_i18n( $comments_number ), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
42 |
get_the_title() |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
43 |
); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
44 |
} |
5 | 45 |
?> |
46 |
</h2> |
|
47 |
||
48 |
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?> |
|
49 |
<nav id="comment-nav-above" class="navigation comment-navigation" role="navigation"> |
|
50 |
<h1 class="screen-reader-text"><?php _e( 'Comment navigation', 'twentyfourteen' ); ?></h1> |
|
51 |
<div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'twentyfourteen' ) ); ?></div> |
|
52 |
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'twentyfourteen' ) ); ?></div> |
|
53 |
</nav><!-- #comment-nav-above --> |
|
54 |
<?php endif; // Check for comment navigation. ?> |
|
55 |
||
56 |
<ol class="comment-list"> |
|
57 |
<?php |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
58 |
wp_list_comments( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
59 |
array( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
60 |
'style' => 'ol', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
61 |
'short_ping' => true, |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
62 |
'avatar_size' => 34, |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
63 |
) |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
64 |
); |
5 | 65 |
?> |
66 |
</ol><!-- .comment-list --> |
|
67 |
||
68 |
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?> |
|
69 |
<nav id="comment-nav-below" class="navigation comment-navigation" role="navigation"> |
|
70 |
<h1 class="screen-reader-text"><?php _e( 'Comment navigation', 'twentyfourteen' ); ?></h1> |
|
71 |
<div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'twentyfourteen' ) ); ?></div> |
|
72 |
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'twentyfourteen' ) ); ?></div> |
|
73 |
</nav><!-- #comment-nav-below --> |
|
74 |
<?php endif; // Check for comment navigation. ?> |
|
75 |
||
76 |
<?php if ( ! comments_open() ) : ?> |
|
77 |
<p class="no-comments"><?php _e( 'Comments are closed.', 'twentyfourteen' ); ?></p> |
|
78 |
<?php endif; ?> |
|
79 |
||
80 |
<?php endif; // have_comments() ?> |
|
81 |
||
82 |
<?php comment_form(); ?> |
|
83 |
||
84 |
</div><!-- #comments --> |