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 |
|
28 |
printf( _nx( 'One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'comments title', 'twentyfifteen' ), |
|
29 |
number_format_i18n( get_comments_number() ), get_the_title() ); |
|
30 |
?> |
|
31 |
</h2> |
|
32 |
|
|
33 |
<?php twentyfifteen_comment_nav(); ?> |
|
34 |
|
|
35 |
<ol class="comment-list"> |
|
36 |
<?php |
|
37 |
wp_list_comments( array( |
|
38 |
'style' => 'ol', |
|
39 |
'short_ping' => true, |
|
40 |
'avatar_size' => 56, |
|
41 |
) ); |
|
42 |
?> |
|
43 |
</ol><!-- .comment-list --> |
|
44 |
|
|
45 |
<?php twentyfifteen_comment_nav(); ?> |
|
46 |
|
|
47 |
<?php endif; // have_comments() ?> |
|
48 |
|
|
49 |
<?php |
|
50 |
// If comments are closed and there are comments, let's leave a little note, shall we? |
|
51 |
if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : |
|
52 |
?> |
|
53 |
<p class="no-comments"><?php _e( 'Comments are closed.', 'twentyfifteen' ); ?></p> |
|
54 |
<?php endif; ?> |
|
55 |
|
|
56 |
<?php comment_form(); ?> |
|
57 |
|
|
58 |
</div><!-- .comments-area --> |