2018-11-04 11:13:42 +02:00
|
|
|
<?php
|
2018-12-19 14:46:42 +02:00
|
|
|
/**
|
2024-04-24 11:36:24 +03:00
|
|
|
* The template for displaying the list of comments and the comment form.
|
2019-07-11 19:10:44 +03:00
|
|
|
*
|
|
|
|
* @package HelloElementor
|
2018-12-19 14:46:42 +02:00
|
|
|
*/
|
|
|
|
|
2018-11-04 12:19:44 +02:00
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
2019-07-11 18:37:10 +03:00
|
|
|
exit; // Exit if accessed directly.
|
2018-11-04 12:19:44 +02:00
|
|
|
}
|
2018-11-04 11:13:42 +02:00
|
|
|
|
2023-03-27 17:00:13 +03:00
|
|
|
if ( ! post_type_supports( get_post_type(), 'comments' ) ) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( ! have_comments() && ! comments_open() ) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2019-07-11 18:37:10 +03:00
|
|
|
// Comment Reply Script.
|
2018-11-04 11:13:42 +02:00
|
|
|
if ( comments_open() && get_option( 'thread_comments' ) ) {
|
|
|
|
wp_enqueue_script( 'comment-reply' );
|
|
|
|
}
|
|
|
|
?>
|
2018-03-19 13:51:18 +02:00
|
|
|
<section id="comments" class="comments-area">
|
|
|
|
|
|
|
|
<?php if ( have_comments() ) : ?>
|
2024-07-24 06:09:06 -07:00
|
|
|
<h2 class="title-comments">
|
2019-02-12 12:04:43 +02:00
|
|
|
<?php
|
|
|
|
$comments_number = get_comments_number();
|
|
|
|
if ( '1' === $comments_number ) {
|
2019-07-11 18:37:10 +03:00
|
|
|
printf( esc_html_x( 'One Response', 'comments title', 'hello-elementor' ) );
|
2019-02-12 12:04:43 +02:00
|
|
|
} else {
|
|
|
|
printf(
|
2024-04-24 11:36:24 +03:00
|
|
|
/* translators: %s: Number of comments. */
|
|
|
|
esc_html(
|
2019-07-11 18:37:10 +03:00
|
|
|
_nx(
|
2024-04-24 11:36:24 +03:00
|
|
|
'%s Response',
|
|
|
|
'%s Responses',
|
2019-07-11 18:37:10 +03:00
|
|
|
$comments_number,
|
|
|
|
'comments title',
|
|
|
|
'hello-elementor'
|
|
|
|
)
|
2019-02-12 12:04:43 +02:00
|
|
|
),
|
2019-07-11 18:37:10 +03:00
|
|
|
esc_html( number_format_i18n( $comments_number ) )
|
2019-02-12 12:04:43 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
?>
|
2024-07-24 06:09:06 -07:00
|
|
|
</h2>
|
2018-03-19 13:51:18 +02:00
|
|
|
|
2019-07-11 18:37:10 +03:00
|
|
|
<?php the_comments_navigation(); ?>
|
2018-03-19 13:51:18 +02:00
|
|
|
|
2024-03-19 00:43:48 -07:00
|
|
|
<ol class="comment-list">
|
|
|
|
<?php
|
|
|
|
wp_list_comments(
|
|
|
|
[
|
|
|
|
'style' => 'ol',
|
|
|
|
'short_ping' => true,
|
|
|
|
'avatar_size' => 42,
|
|
|
|
]
|
|
|
|
);
|
|
|
|
?>
|
|
|
|
</ol>
|
2018-03-19 13:51:18 +02:00
|
|
|
|
2019-07-11 18:37:10 +03:00
|
|
|
<?php the_comments_navigation(); ?>
|
2018-03-19 13:51:18 +02:00
|
|
|
|
2024-03-19 00:43:48 -07:00
|
|
|
<?php endif; ?>
|
2018-03-19 13:51:18 +02:00
|
|
|
|
2024-03-19 00:43:48 -07:00
|
|
|
<?php
|
|
|
|
comment_form(
|
|
|
|
[
|
2024-07-24 06:09:06 -07:00
|
|
|
'title_reply_before' => '<h2 id="reply-title" class="comment-reply-title">',
|
|
|
|
'title_reply_after' => '</h2>',
|
2024-03-19 00:43:48 -07:00
|
|
|
]
|
|
|
|
);
|
|
|
|
?>
|
2018-03-19 13:51:18 +02:00
|
|
|
|
2024-03-19 00:43:48 -07:00
|
|
|
</section>
|