Repository navigation
Expand file tree
/
Copy pathcomments.php
More file actions
54 lines (46 loc) · 1.97 KB
/
Copy pathcomments.php
File metadata and controls
54 lines (46 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
/**
* The template for displaying Comments.
*/
?>
<div id="comments">
<?php if ( post_password_required() ) : ?>
<p class="nopassword"><?php _e( 'This post is password protected. Enter the password to view any comments.', 'koster' ); ?></p>
</div><!-- #comments -->
<?php
return;
endif;
?>
<?php if ( have_comments() ) : ?>
<h2 id="comments-title">
<?php
printf( _n( 'One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'koster' ),
number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' );
?>
</h2>
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
<nav id="comment-nav-above">
<h1 class="assistive-text"><?php _e( 'Comment navigation', 'koster' ); ?></h1>
<div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'koster' ) ); ?></div>
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'koster' ) ); ?></div>
</nav>
<?php endif; // check for comment navigation ?>
<ol class="commentlist">
<?php
wp_list_comments();
?>
</ol>
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
<nav id="comment-nav-below">
<h1 class="assistive-text"><?php _e( 'Comment navigation', 'koster' ); ?></h1>
<div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'koster' ) ); ?></div>
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'koster' ) ); ?></div>
</nav>
<?php endif; // check for comment navigation ?>
<?php
elseif ( ! comments_open() && post_type_supports( get_post_type(), 'comments' ) ) :
?>
<p class="nocomments"><?php _e( 'Comments are closed.', 'koster' ); ?></p>
<?php endif; ?>
<?php comment_form(); ?>
</div><!-- #comments -->