<?php
/**
 * The template for displaying Author Archive pages.
 *
 * Used to display archive-type pages for posts by an author.
 *
 * Learn more: http://codex.wordpress.org/Template_Hierarchy
 *
 * @package Serpentsoft
 * @subpackage Adams_news
 * @since Adams News 1.0
 */
get_header(); ?>

<!-- Author Archive -->
<article class="article-container" itemscope itemtype="http://schema.org/Article" role="main">
    <div class="row-fluid">
	<?php if ( have_posts() ) : ?>
        
            <?php /* Queue the first post, that way we know
                 * what author we're dealing with (if that is the case).
                 *
                 * We reset this later so we can run the loop
                 * properly with a call to rewind_posts().
                 */
                the_post(); ?>

        <div class="article-content">
            <header>
                <?php serpentsoft_single_breadcrumb(); ?>

                <h1 itemprop="headline"><?php printf( __( 'Author Archives: %s', 'serpentsoft' ), '<span class="vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( "ID" ) ) ) . '" title="' . esc_attr( get_the_author() ) . '" rel="me">' . get_the_author() . '</a></span>' ); ?></h1>

                <div class="post-info"></div>

            </header>

            <?php /* Since we called the_post() above, we need to
                 * rewind the loop back to the beginning that way
                 * we can run the loop properly, in full.
                 */
                rewind_posts(); ?>
            
            <span class="clearfix"></span>

            <?php if( serpentsoft_get_data('serpentsoft_switch_author_bio') ): /* if( get_the_author_meta('description') ): */ ?>
            
            <div class="authors-page">
            
            <!-- Author Biography -->
            <aside class="row-fluid">
                <ul class="authors">

                    <li class="media" itemprop="author" itemscope itemtype="http://schema.org/Person">

                        <a href="<?php esc_url( get_author_posts_url(get_the_author_meta("ID")) ); ?>" class="span2" title="<?php esc_attr( get_the_author() ); ?>" rel="me">
                        
                            <div class="media-object thumb-effect">

                                <div class="mask"></div>
                                <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'serpentsoft_author_bio_avatar_size', 88 ) ); ?>
                                
                            </div>
                        </a>

                        <div class="media-body span10">
                            <a itemprop="name" href="<?php esc_url( get_author_posts_url(get_the_author_meta("ID")) ); ?>" title="<?php esc_attr( get_the_author() ); ?>">
                                <h4 class="media-heading"><?php echo get_the_author(); ?></h4>
                            </a>

                            <div class="media">
                                <div itemprop="description">
                                    <p><?php the_author_meta( 'description' ); ?></p>
                                </div>
                                
                                <?php serpentsoft_author_social_icons_list(get_the_author_meta('ID')); ?>
                            </div>
                            
                        </div>
                    </li>

                </ul>
            </aside>

            </div><!-- div Author Page -->
            
            <?php endif; ?>
            
        <span class="clearfix"></span>
			
            <!-- Blog -->
            
            <div class="blog">
                <ul class="media-list">
                <?php while ( have_posts() ) : the_post();
                    get_template_part('loop', 'blog');
                endwhile; ?>
                </ul>
                
                <div class="row-fluid paging-footer">

                    <?php serpentsoft_bootstrap_pagination(); ?>

                </div>
                
            </div>
            
	</div><!-- div Article Content -->
	<?php endif; ?><!-- if have posts -->
    
    </div>
</article>

<?php get_footer(); ?>