Files
WFK_theme/comments.php

66 lines
1.8 KiB
PHP

<?php
/**
* The template for displaying comments
*/
if (post_password_required()) {
return;
}
?>
<div id="comments" class="comments-area reading-container">
<?php if (have_comments()): ?>
<h2 class="comments-title">
<?php
$comment_count = get_comments_number();
if ('1' === $comment_count) {
printf(
esc_html__('One thought on &ldquo;%1$s&rdquo;', 'wisdom1'),
'<span>' . get_the_title() . '</span>'
);
} else {
printf(
esc_html(_nx('%1$s thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', $comment_count, 'comments title', 'wisdom1')),
number_format_i18n($comment_count),
'<span>' . get_the_title() . '</span>'
);
}
?>
</h2>
<ol class="comment-list">
<?php
wp_list_comments(
array(
'style' => 'ol',
'short_ping' => true,
'avatar_size' => 60,
)
);
?>
</ol>
<?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__('Comments are closed.', 'wisdom1'); ?></p>
<?php
endif;
endif; // Check for have_comments().
$args = array(
'class_form' => 'comment-form mt-4',
'class_submit' => 'btn btn-secondary fw-bold text-uppercase mt-3',
'title_reply_before' => '<h2 id="reply-title" class="comment-reply-title h4 font-sans mb-4">',
'title_reply_after' => '</h2>',
'comment_field' => '<div class="comment-form-comment mb-3"><label for="comment" class="form-label text-muted small text-uppercase tracking-wider fw-bold">Add a Perspective <span class="text-danger">*</span></label><textarea id="comment" name="comment" cols="45" rows="4" maxlength="65525" required="required" class="form-control"></textarea></div>',
);
comment_form($args);
?>
</div><!-- #comments -->