RP_Rave1_theme/comments0.php

50 lines
1.3 KiB
PHP
Raw Normal View History

2024-11-06 10:10:48 +00:00
<?php
// Ha a bejegyzés jelszóval védett és a jelszó nincs megadva, akkor ne jelenítsünk meg hozzászólásokat
if (post_password_required()) {
return;
}
?>
<div id="comments" class="comments-area">
<?php if (have_comments()) : ?>
<h2 class="comments-title">
<?php
$comment_count = get_comments_number();
if ('1' === $comment_count) {
printf(
/* translators: %s: post title */
esc_html__('One thought on &ldquo;%s&rdquo;', 'sandbox'),
'<span>' . get_the_title() . '</span>'
);
} else {
printf( // WPCS: XSS OK.
/* translators: 1: comment count number, 2: post title */
esc_html(_nx('%1$s thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', $comment_count, 'comments title', 'sandbox')),
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,
));
?>
</ol><!-- .comment-list -->
<?php the_comments_navigation(); ?>
<?php if (!comments_open() && get_comments_number()) : ?>
<p class="no-comments"><?php esc_html_e('Comments are closed.', 'sandbox'); ?></p>
<?php endif; ?>
<?php endif; ?>
<?php comment_form(); ?>
</div><!-- #comments -->