2014-08-17 16:55:38 +01:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* The template for displaying comments.
|
|
|
|
*
|
|
|
|
* The area of the page that contains both current comments
|
|
|
|
* and the comment form.
|
|
|
|
*
|
|
|
|
* @package storefront
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* 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;
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
|
2016-07-27 19:40:14 +02:00
|
|
|
<section id="comments" class="comments-area" aria-label="Post Comments">
|
2014-08-17 16:55:38 +01:00
|
|
|
|
2016-02-19 16:57:56 +00:00
|
|
|
<?php
|
|
|
|
if ( have_comments() ) : ?>
|
2014-08-17 16:55:38 +01:00
|
|
|
<h2 class="comments-title">
|
|
|
|
<?php
|
2016-08-01 11:17:10 +01:00
|
|
|
printf( // WPCS: XSS OK.
|
|
|
|
esc_html( _nx( 'One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'comments title', 'storefront' ) ),
|
|
|
|
number_format_i18n( get_comments_number() ),
|
|
|
|
'<span>' . get_the_title() . '</span>'
|
|
|
|
);
|
2014-08-17 16:55:38 +01:00
|
|
|
?>
|
|
|
|
</h2>
|
|
|
|
|
2016-08-01 11:17:10 +01:00
|
|
|
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through. ?>
|
2016-07-27 19:40:14 +02:00
|
|
|
<nav id="comment-nav-above" class="comment-navigation" role="navigation" aria-label="Comment Navigation Above">
|
2016-08-01 11:17:10 +01:00
|
|
|
<span class="screen-reader-text"><?php esc_html_e( 'Comment navigation', 'storefront' ); ?></span>
|
2014-08-17 16:55:38 +01:00
|
|
|
<div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'storefront' ) ); ?></div>
|
|
|
|
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'storefront' ) ); ?></div>
|
|
|
|
</nav><!-- #comment-nav-above -->
|
2016-08-01 11:17:10 +01:00
|
|
|
<?php endif; // Check for comment navigation. ?>
|
2014-08-17 16:55:38 +01:00
|
|
|
|
|
|
|
<ol class="comment-list">
|
|
|
|
<?php
|
|
|
|
wp_list_comments( array(
|
|
|
|
'style' => 'ol',
|
|
|
|
'short_ping' => true,
|
|
|
|
'callback' => 'storefront_comment',
|
|
|
|
) );
|
|
|
|
?>
|
|
|
|
</ol><!-- .comment-list -->
|
|
|
|
|
2016-08-01 11:17:10 +01:00
|
|
|
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through. ?>
|
2016-07-27 19:40:14 +02:00
|
|
|
<nav id="comment-nav-below" class="comment-navigation" role="navigation" aria-label="Comment Navigation Below">
|
2016-08-01 11:17:10 +01:00
|
|
|
<span class="screen-reader-text"><?php esc_html_e( 'Comment navigation', 'storefront' ); ?></span>
|
2014-08-17 16:55:38 +01:00
|
|
|
<div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'storefront' ) ); ?></div>
|
|
|
|
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'storefront' ) ); ?></div>
|
|
|
|
</nav><!-- #comment-nav-below -->
|
2016-08-01 11:17:10 +01:00
|
|
|
<?php endif; // Check for comment navigation.
|
2014-08-17 16:55:38 +01:00
|
|
|
|
2016-08-01 11:17:10 +01:00
|
|
|
endif;
|
2014-08-17 16:55:38 +01:00
|
|
|
|
2016-01-21 10:50:49 +00:00
|
|
|
if ( ! comments_open() && '0' != get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : ?>
|
2016-08-01 11:17:10 +01:00
|
|
|
<p class="no-comments"><?php esc_html_e( 'Comments are closed.', 'storefront' ); ?></p>
|
2016-01-21 10:50:49 +00:00
|
|
|
<?php endif;
|
2014-08-17 16:55:38 +01:00
|
|
|
|
2016-08-01 11:17:10 +01:00
|
|
|
$args = apply_filters( 'storefront_comment_form_args', array(
|
|
|
|
'title_reply_before' => '<span id="reply-title" class="gamma comment-reply-title">',
|
|
|
|
'title_reply_after' => '</span>',
|
|
|
|
) );
|
2014-08-17 16:55:38 +01:00
|
|
|
|
2016-07-27 19:40:14 +02:00
|
|
|
comment_form( $args ); ?>
|
|
|
|
|
|
|
|
</section><!-- #comments -->
|