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

<?php if ( have_comments() || comments_open() ) : ?>
<div id="comments-wrapper">
	<div class="comments-content" id="comments">

	<?php if ( have_comments() ) : ?>

		<h3><?php comments_number( esc_html__('No Comments', 'toppic'), esc_html__('1 Comment', 'toppic'), esc_html__('% Comments', 'toppic') );?> </h3>
		
		<ol class="commentlist">		
			<?php kktfwp_comment_nav(); ?>
		
			<?php wp_list_comments('type=all&avatar_size=60&callback=toppic_comment'); ?>
			
			<?php kktfwp_comment_nav(); ?>
		</ol>
	<?php endif; ?>
	
	<?php
		// If comments are closed and there are comments, let's leave a little note, shall we?
		if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
	?>
		<p class="no-comments"><?php esc_html_e( 'Comments are closed.', 'toppic' ); ?></p>
	<?php endif; ?>

	<?php if ( comments_open() ) : ?>
		<div class="wrapper" id="form-main">

			<?php 	
						$fields =  array(
							'author' => '<ul><li><input type="text" placeholder="Name *" name="author" size="22" tabindex="1" aria-required="true"  class="input-name"  /></li>',
							'email'  => '<li><input type="text" placeholder="E-mail *" name="email" size="22" tabindex="2" aria-required="true" class="input-email"  /></li>',
							'url'    => '<li><input type="text" placeholder="Website" name="url" size="22" tabindex="3" class="input-website" /></li></ul>',
						); 

						$args = array(  
							'fields' => apply_filters( 'comment_form_default_fields', $fields ),
							'comment_field' => '<textarea name="comment" id="comment" cols="39" rows="4" tabindex="4" class="textarea-comment"></textarea>',
							'comment_notes_before' => '',
							'comment_notes_after' => '',
							'label_submit' => esc_html__( 'Submit Comment','toppic' )
						);  
						
						comment_form($args); ?>			

		</div>
	<?php endif; ?>
	</div>
</div>
<?php endif; ?>