author | ymh <ymh.work@gmail.com> |
Mon, 14 Oct 2019 17:39:30 +0200 | |
changeset 7 | cf61fcea0001 |
parent 0 | d970ebf37754 |
permissions | -rw-r--r-- |
0 | 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. The actual display of comments is |
|
7 |
* handled by a callback to twentytwelve_comment() which is |
|
8 |
* located in the functions.php file. |
|
9 |
* |
|
10 |
* @package WordPress |
|
11 |
* @subpackage Twenty_Twelve |
|
12 |
* @since Twenty Twelve 1.0 |
|
13 |
*/ |
|
14 |
||
15 |
/* |
|
16 |
* If the current post is protected by a password and |
|
17 |
* the visitor has not yet entered the password we will |
|
18 |
* return early without loading the comments. |
|
19 |
*/ |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
20 |
if ( post_password_required() ) { |
0 | 21 |
return; |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
22 |
} |
0 | 23 |
?> |
24 |
||
25 |
<div id="comments" class="comments-area"> |
|
26 |
||
27 |
<?php // You can start editing here -- including this comment! ?> |
|
28 |
||
29 |
<?php if ( have_comments() ) : ?> |
|
30 |
<h2 class="comments-title"> |
|
31 |
<?php |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
32 |
printf( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
33 |
_n( 'One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'twentytwelve' ), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
34 |
number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
35 |
); |
0 | 36 |
?> |
37 |
</h2> |
|
38 |
||
39 |
<ol class="commentlist"> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
40 |
<?php |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
41 |
wp_list_comments( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
42 |
array( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
43 |
'callback' => 'twentytwelve_comment', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
44 |
'style' => 'ol', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
45 |
) |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
46 |
); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
47 |
?> |
0 | 48 |
</ol><!-- .commentlist --> |
49 |
||
50 |
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?> |
|
51 |
<nav id="comment-nav-below" class="navigation" role="navigation"> |
|
52 |
<h1 class="assistive-text section-heading"><?php _e( 'Comment navigation', 'twentytwelve' ); ?></h1> |
|
53 |
<div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'twentytwelve' ) ); ?></div> |
|
54 |
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'twentytwelve' ) ); ?></div> |
|
55 |
</nav> |
|
56 |
<?php endif; // check for comment navigation ?> |
|
57 |
||
58 |
<?php |
|
59 |
/* If there are no comments and comments are closed, let's leave a note. |
|
60 |
* But we only want the note on posts and pages that had comments in the first place. |
|
61 |
*/ |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
62 |
if ( ! comments_open() && get_comments_number() ) : |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
63 |
?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
64 |
<p class="nocomments"><?php _e( 'Comments are closed.', 'twentytwelve' ); ?></p> |
0 | 65 |
<?php endif; ?> |
66 |
||
67 |
<?php endif; // have_comments() ?> |
|
68 |
||
69 |
<?php comment_form(); ?> |
|
70 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
71 |
</div><!-- #comments .comments-area --> |