<?php
/*
The comments page for thefashblog
*/

// don't load it if you can't comment
if ( post_password_required() ) {
  return;
}

?>

<?php // You can start editing here. ?>

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

    <section class="commentlist">
      
      <h3 class="comments-title" class="h2">
      <?php
        $comments_number = get_comments_number();
        if ( '1' === $comments_number ) {
          /* translators: %s: post title */
          printf( _x( 'One Reply to &ldquo;%s&rdquo;', 'comments title', 'the-fash-blog' ), get_the_title() );
        } else {
          printf(
            /* translators: 1: number of comments, 2: post title */
            _nx(
              '%1$s Reply to &ldquo;%2$s&rdquo;',
              '%1$s Replies to &ldquo;%2$s&rdquo;',
              $comments_number,
              'comments title',
              'the-fash-blog'
            ),
            number_format_i18n( $comments_number ),
            get_the_title()
          );
        }
      ?>
    </h3>
      <?php
        wp_list_comments( array(
          'style'             => 'div',
          'short_ping'        => true,
          'avatar_size'       => 100,
          'callback'          => 'thefashblog_comments',
          'type'              => 'all',
          'reply_text'        => 'Reply',
          'page'              => '',
          'per_page'          => '',
          'reverse_top_level' => null,
          'reverse_children'  => '',
          'max_depth'         => 3
        ) );
      ?>
    </section>

    <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?>
    	<nav class="navigation comment-navigation" role="navigation">
      	<div class="comment-nav-prev"><?php previous_comments_link( __( '&larr; Previous Comments', 'the-fash-blog' ) ); ?></div>
      	<div class="comment-nav-next"><?php next_comments_link( __( 'Next Comments &rarr;', 'the-fash-blog' ) ); ?></div>
    	</nav>
    <?php endif; ?>

    <?php if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : ?>
    	<p class="no-comments"><?php _e( 'Comments are closed.' , 'the-fash-blog' ); ?></p>
    <?php endif; ?>

  <?php endif; ?>

  <?php comment_form(); ?>