-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcomments.php
More file actions
62 lines (49 loc) · 1.39 KB
/
Copy pathcomments.php
File metadata and controls
62 lines (49 loc) · 1.39 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
55
56
57
58
59
60
61
62
<?php
// exit if post is password-protected
if ( post_password_required() ) {
return;
}
// exit if comments are closed and none exist
if ( ! comments_open() && ! get_comments_number() ) {
return;
}
?>
<div id="comments" class="comments-area">
<?php if ( have_comments() ) : ?>
<h3 class="comments-title">
<?php
$hovercraft_comment_count = get_comments_number();
if ( 1 === (int) $hovercraft_comment_count ) {
printf(
esc_html__( 'One comment on %s', 'hovercraft' ),
'<span>' . esc_html( get_the_title() ) . '</span>'
);
} else {
printf(
esc_html( _nx( '%1$s comment on %2$s', '%1$s comments on %2$s', $hovercraft_comment_count, 'comments title', 'hovercraft' ) ),
number_format_i18n( $hovercraft_comment_count ),
'<span>' . esc_html( get_the_title() ) . '</span>'
);
}
?>
</h3>
<?php the_comments_navigation(); ?>
<ol class="comment-list">
<?php
wp_list_comments( apply_filters( 'hovercraft_comments_args', array(
'style' => 'ol',
) ) );
?>
</ol><!-- comment-list -->
<?php the_comments_navigation(); ?>
<?php endif; // end have_comments ?>
<?php if ( ! comments_open() && get_comments_number() ) : ?>
<p class="no-comments">
<?php esc_html_e( 'Comments are closed.', 'hovercraft' ); ?>
</p>
<?php endif; // end comments_open ?>
<?php
// display the comment form
comment_form();
?>
</div><!-- comments -->