<?php
/**
 * Comments Template
 *
 * Please do not edit this file. This file is part of the CyberChimps Framework and all modifications
 * should be made in a child theme.
 *
 * @category CyberChimps Framework
 * @package  Framework
 * @since    1.0
 * @author   CyberChimps
 * @license  http://www.opensource.org/licenses/gpl-license.php GPL v3.0 (or later)
 * @link     http://www.cyberchimps.com/
 */

	/*
	 * 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;
}
?>

	<div id="comments" class="comments-area">

	<?php
	// You can start editing here -- including this comment.
	if ( have_comments() ) :
	?>
		<h3 class="comments-title">
			<?php comments_number( esc_html__( 'Comments (0)', 'compact-one' ), esc_html__( 'Comments (1)', 'compact-one' ), esc_html__( 'Comments (%)', 'compact-one' ) ); ?>
		</h3>

		<?php
		if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through.
		?>
		<nav role="navigation" id="comment-nav-above" class="site-navigation comment-navigation">
			<h4 class="assistive-text"><?php esc_html_e( 'Comment navigation', 'compact-one' ); ?></h4>
			<div class="nav-previous"><?php previous_comments_link( '&larr; ' . __( 'Older Comments', 'compact-one' ) ); ?></div>
			<div class="nav-next"><?php next_comments_link( __( 'Newer Comments', 'compact-one' ) . ' &rarr;' ); ?></div>
		</nav>
		<?php
		endif; // check for comment navigation.
		?>

		<ol class="commentlist">
			<?php
				wp_list_comments(
					array(
						'style'      => 'ol',
						'short_ping' => true,
					)
				);
			?>
		</ol>

		<?php
		if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through.
		?>
		<nav role="navigation" id="comment-nav-below" class="site-navigation comment-navigation">
			<h4 class="assistive-text"><?php esc_html_e( 'Comment navigation', 'compact-one' ); ?></h4>
			<div class="nav-previous"><?php previous_comments_link( '&larr; ' . __( 'Older Comments', 'compact-one' ) ); ?></div>
			<div class="nav-next"><?php next_comments_link( __( 'Newer Comments', 'compact-one' ) . ' &rarr;' ); ?></div>
		</nav>
		<?php
			endif; // check for comment navigation.
		endif; // have_comments().

	// If comments are closed and there are comments, let's leave a little note, shall we?
	if ( ! comments_open() ) :
	?>
		<p class="nocomments"><?php esc_html_e( 'Comments are closed.', 'compact-one' ); ?></p>
	<?php
	endif;

	comment_form();
	?>

</div><!-- #comments .comments-area -->
