-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathcomments.php
More file actions
91 lines (90 loc) · 2.32 KB
/
comments.php
File metadata and controls
91 lines (90 loc) · 2.32 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?php
/**
* The template for displaying comments
*
* This is the template that displays the area of the page that contains both the current comments
* and the comment form.
*
* @package Fold
* @link https://codex.wordpress.org/Template_Hierarchy
*/
/*
* If the current post is protected by a password and
* the visitor has not yet entered the password we will
* return early without loading the comments.
*/
if ( post_password_required() ) {
return;
}
?>
<div id="comments" class="shadow rounded mb-3 p-3">
<?php
// You can start editing here -- including this comment!
if ( have_comments() ) {
?>
<h2>
<?php
$comments_number = get_comments_number();
if ( '1' === $comments_number ) {
/* translators: %s: post title */
printf( esc_html__( 'One Reply to “%s”', 'fold' ), esc_html( get_the_title() ) );
} else {
printf(
esc_html(
/* translators: 1: number of comments, 2: post title */
_n(
'%1$s Reply to “%2$s”',
'%1$s Replies to “%2$s”',
intval( $comments_number ),
'fold'
)
),
esc_html( number_format_i18n( intval( $comments_number ) ) ),
esc_html( get_the_title() )
);
}
?>
</h2>
<div>
<?php
FOLD()::comments_pagination(
array(
'prev_text' => '<span>' . esc_html__( 'Previous', 'fold' ) . '</span>',
'next_text' => '<span>' . esc_html__( 'Next', 'fold' ) . '</span>',
'type' => 'list',
)
);
?>
<ol id="comment-list">
<?php
wp_list_comments(
array(
'walker' => new \Fold\Walker_Bootstrap_Comment(),
'avatar_size' => 100,
'style' => 'ol',
'short_ping' => true,
)
);
?>
</ol>
<?php
FOLD()::comments_pagination(
array(
'prev_text' => '<span>' . esc_html__( 'Previous', 'fold' ) . '</span>',
'next_text' => '<span>' . esc_html__( 'Next', 'fold' ) . '</span>',
'type' => 'list',
)
);
?>
</div>
<?php
}//end if
// If comments are closed and there are comments, let's leave a little note, shall we?
if ( ! comments_open() && (bool) get_comments_number() && post_type_supports( (string) get_post_type(), 'comments' ) ) {
?>
<p><?php esc_html_e( 'Comments are closed.', 'fold' ); ?></p>
<?php
}
?>
<?php FOLD()::validate_comment_form(); ?>
</div>