2012-01-07 03:25:13 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2016-09-27 06:20:40 +00:00
|
|
|
* The template for displaying comments
|
2012-01-07 03:25:13 +00:00
|
|
|
*
|
2015-07-01 15:21:44 +00:00
|
|
|
* This is the template that displays the area of the page that contains both the current comments
|
2014-02-07 16:08:48 +00:00
|
|
|
* and the comment form.
|
2012-01-07 03:25:13 +00:00
|
|
|
*
|
2017-10-29 08:51:29 +00:00
|
|
|
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
|
2015-07-01 15:21:44 +00:00
|
|
|
*
|
2012-01-07 03:25:13 +00:00
|
|
|
* @package _s
|
|
|
|
*/
|
2012-04-23 21:08:58 +00:00
|
|
|
|
2013-04-28 11:13:55 +00:00
|
|
|
/*
|
|
|
|
* 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.
|
|
|
|
*/
|
2013-11-14 12:49:50 +00:00
|
|
|
if ( post_password_required() ) {
|
2013-04-28 11:13:55 +00:00
|
|
|
return;
|
2013-11-14 12:49:50 +00:00
|
|
|
}
|
2012-04-23 21:08:58 +00:00
|
|
|
?>
|
|
|
|
|
2013-10-10 17:16:32 +00:00
|
|
|
<div id="comments" class="comments-area">
|
2012-01-07 03:25:13 +00:00
|
|
|
|
2015-11-11 21:59:40 +00:00
|
|
|
<?php
|
|
|
|
// You can start editing here -- including this comment!
|
|
|
|
if ( have_comments() ) : ?>
|
2012-02-01 19:35:10 +00:00
|
|
|
<h2 class="comments-title">
|
2012-01-07 03:25:13 +00:00
|
|
|
<?php
|
2017-06-28 01:27:25 +00:00
|
|
|
$comment_count = get_comments_number();
|
|
|
|
if ( 1 === $comment_count ) {
|
|
|
|
printf(
|
|
|
|
/* translators: 1: title. */
|
2017-11-05 18:13:42 +00:00
|
|
|
esc_html__( 'One thought on “%1$s”', '_s' ),
|
2017-06-28 01:27:25 +00:00
|
|
|
'<span>' . get_the_title() . '</span>'
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
printf( // WPCS: XSS OK.
|
|
|
|
/* 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', '_s' ) ),
|
|
|
|
number_format_i18n( $comment_count ),
|
|
|
|
'<span>' . get_the_title() . '</span>'
|
|
|
|
);
|
|
|
|
}
|
2012-01-07 03:25:13 +00:00
|
|
|
?>
|
2016-08-17 02:24:36 +00:00
|
|
|
</h2><!-- .comments-title -->
|
2012-01-07 03:25:13 +00:00
|
|
|
|
2015-12-07 17:02:25 +00:00
|
|
|
<?php the_comments_navigation(); ?>
|
2012-01-07 03:25:13 +00:00
|
|
|
|
2013-02-27 22:03:03 +00:00
|
|
|
<ol class="comment-list">
|
2013-12-23 23:26:50 +00:00
|
|
|
<?php
|
2014-06-25 09:31:51 +00:00
|
|
|
wp_list_comments( array(
|
|
|
|
'style' => 'ol',
|
|
|
|
'short_ping' => true,
|
|
|
|
) );
|
2013-12-23 23:26:50 +00:00
|
|
|
?>
|
2013-03-05 00:41:38 +00:00
|
|
|
</ol><!-- .comment-list -->
|
2012-01-07 03:25:13 +00:00
|
|
|
|
2015-12-07 17:02:25 +00:00
|
|
|
<?php the_comments_navigation();
|
2012-01-07 03:25:13 +00:00
|
|
|
|
2017-07-14 15:52:14 +00:00
|
|
|
// 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.', '_s' ); ?></p>
|
|
|
|
<?php
|
|
|
|
endif;
|
2012-01-07 03:25:13 +00:00
|
|
|
|
2017-07-14 15:52:14 +00:00
|
|
|
endif; // Check for have_comments().
|
2012-01-07 03:25:13 +00:00
|
|
|
|
2015-11-11 21:59:40 +00:00
|
|
|
comment_form();
|
|
|
|
?>
|
2012-01-07 03:25:13 +00:00
|
|
|
|
2013-03-05 00:41:38 +00:00
|
|
|
</div><!-- #comments -->
|