Repository navigation
Expand file tree
/
Copy pathcomments.php
More file actions
116 lines (106 loc) · 4.52 KB
/
Copy pathcomments.php
File metadata and controls
116 lines (106 loc) · 4.52 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<?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 Travel Tour
*/
/*
* 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="comments-area mt-32">
<?php
// You can start editing here -- including this comment!
if ( have_comments() ) :
?>
<h2 class="mt-48 mb-16 fs-3">
<?php
$comment_count = get_comments_number();
if ( '1' === $comment_count ) {
printf(
/* translators: 1: title. */
esc_html__( 'One thought on “%1$s”', 'travel-tour' ),
'<span>' . wp_kses_post( get_the_title() ) . '</span>'
);
} else {
printf(
/* translators: 1: comment count number, 2: title. */
esc_html( _nx( '%1$s thought on “%2$s”', '%1$s thoughts on “%2$s”', $comment_count, 'comments title', 'travel-tour' ) ),
number_format_i18n( $comment_count ), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
'<span>' . wp_kses_post( get_the_title() ) . '</span>'
);
}
?>
</h2><!-- .comments-title -->
<?php the_comments_navigation(); ?>
<div class="comment-list p-0 m-0 mt-24">
<?php
wp_list_comments(
array(
'walker' => new Travel_Tour_Bootstrap_Comment_Walker(),
'max_depth' => '',
'style' => 'div',
'callback' => null,
'end-callback' => null,
'type' => 'all',
'page' => '',
'per_page' => '',
'avatar_size' => 32,
'reverse_top_level' => null,
'reverse_children' => '',
'format' => 'html5',
'short_ping' => true,
'echo' => true
)
);
?>
</div><!-- .comment-list -->
<?php
the_comments_navigation();
// If comments are closed and there are comments, let's leave a little note, shall we?
if ( ! comments_open() ) :
?>
<p class="no-comments"><?php esc_html_e( 'Comments are closed.', 'travel-tour' ); ?></p>
<?php
endif;
endif; // Check for have_comments().
comment_form(
array(
'title_reply_before' => '<h2 class="mb-16">',
'title_reply_after' => '</h2>',
'fields' => array(
'author' => '<p class="comment-form-author">' .
'<label for="author" class="form-label">' . __('Your Name', 'travel-tour') . '</label> <span class="required">*</span>' .
'<input id="author" name="author" type="text" value="" size="30" required="required" class="form-control p-16" />' .
'</p>',
'email' => '<p class="comment-form-email">' .
'<label for="email" class="form-label">' . __('Your Email', 'travel-tour') . '</label> <span class="required">*</span>' .
'<input id="email" name="email" type="email" value="" size="30" required="required" class="form-control p-16" />' .
'</p>',
'url' => '<p class="comment-form-url">' .
'<label for="url" class="form-label">' . __('Your Website', 'travel-tour') . '</label>' .
'<input id="url" name="url" type="url" value="" size="30" class="form-control p-16" />' .
'</p>',
'cookies' => '<p class="comment-form-cookies-consent" class="form-check">' .
'<input id="wp-comment-cookies-consent" name="wp-comment-cookies-consent" type="checkbox" value="yes" class="form-check-input" /> ' .
'<label for="wp-comment-cookies-consent" class="form-check-label">' . __('Save my name, email, and website in this browser for the next time I comment.', 'travel-tour') . '</label>' .
'</p>',
),
'comment_field' => '<p class="comment-form-comment">' .
'<label for="comment" class="form-label">' . __('Your Comment', 'travel-tour') . '</label> <span class="required">*</span>' .
'<textarea id="comment" name="comment" cols="45" rows="8" required="required" class="form-control p-16"></textarea>' .
'</p>',
'submit_field' => '<p class="form-submit d-flex justify-content-center">%1$s %2$s</p>',
'submit_button' => '<input name="%1$s" type="submit" id="%2$s" class="submit btn btn-primary text-center" value="%4$s">',
)
);
?>
</div><!-- #comments -->