<?php
/**
 * The template for displaying comments.
 *
 * The area of the page that contains both current comments
 * and the comment form.
 *
 * @package webhosty
 */

/*
 * 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 // You can start editing here -- including this comment! ?>

	<?php if ( have_comments() ) : ?>
		
                                
			<?php
				echo '<h2 class="post-title comm-title">';
			printf( _nx( '<span>One Comments</span>', '<span>%1$s Comments %2$s</span>', get_comments_number(), 'comments title', 'webhosty' ),number_format_i18n( get_comments_number() ), '' );
			?>
		</h2>

		<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
		<nav id="comment-nav-above" class="navigation comment-navigation" role="navigation">
			<h2 class="screen-reader-text"><?php _e( 'Comment navigation', 'webhosty' ); ?></h2>
			<div class="nav-links">

				<div class="nav-previous"><?php previous_comments_link( __( 'Older Comments', 'webhosty' ) ); ?></div>
				<div class="nav-next"><?php next_comments_link( __( 'Newer Comments', 'webhosty' ) ); ?></div>

			</div><!-- .nav-links --> 
		</nav><!-- #comment-nav-above -->
		<?php endif; // check for comment navigation ?>

		<ol class="commentary-box"> 
			<?php
				wp_list_comments( 'type=comment&callback=webhosty_custom_comments');
			?>
		</ol><!-- .comment-list -->

		<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
		<nav id="comment-nav-below" class="navigation comment-navigation" role="navigation">
			<h2 class="screen-reader-text"><?php _e( 'Comment navigation', 'webhosty' ); ?></h2>
			<div class="nav-links">

				<div class="nav-previous"><?php previous_comments_link( __( 'Older Comments', 'webhosty' ) ); ?></div>
				<div class="nav-next"><?php next_comments_link( __( 'Newer Comments', 'webhosty' ) ); ?></div>

			</div><!-- .nav-links -->
		</nav><!-- #comment-nav-below -->
		<?php endif; // check for comment navigation ?>

	<?php endif; // have_comments() ?>

	<?php
		// If comments are closed and there are comments, let's leave a little note, shall we?
		if ( ! comments_open() && '0' != get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
	?>
		<p class="no-comments"><?php _e( 'Comments are closed.', 'webhosty' ); ?></p>
	<?php endif; ?>
	<?php
	$commenter = wp_get_current_commenter();
	$aria_req = ( $req ? " aria-required='true'" : '' );
	$fields =  array(
    'author' => '<div class="form-group group-input "><label for="type-text">'.__('Your Name','webhosty').'*</label><input id="type-text" name="author" class="commentary-input comm-field" type="text" placeholder="'.__('Your First Name','webhosty').'" value="' . esc_attr( $commenter['comment_author'] ).'" ' . $aria_req .' /></div>',
    'email'  => '<div class=" form-group group-input"><label for="type-email">'.__('Your Email ','webhosty').'*</label><input id="type-email" name="email"  class="commentary-input comm-field" type="text" value="' . esc_attr( $commenter['comment_author_email'] ).'" ' . $aria_req .' placeholder="'.__('Your Email','webhosty').'"/></div>',
	  
);   
	 $comments_args = array(
    'fields' =>  $fields,
	'id_form' => 'commentform',
	'comment_field' => '<div class="form-group">
    <label for="type-txt">'.__('Type Your Message :','webhosty').'</label><textarea id="type-txt" class="commentary-textarea comm-field" name="comment" placeholder="'.__('Your Comment','webhosty').'"></textarea></div>',
	'comment_notes_before'=>'',
	'comment_notes_after'=>'',  
	'id_submit'=>'commentsubmit', 
	'title_reply'=>'',   
	);
	echo '<div class="commentary-form clearfix">';
	comment_form($comments_args);   
	echo '</div>';
?>   