<?php
/**
 * The template for displaying Author information.
 */

/**
 * Check whether the 'basho_show_author_in_entry_footer' option is activated in the Customizer.
 */
$show_author_bio = get_theme_mod( 'basho_show_author_in_entry_footer', true );

if ( (bool) get_the_author_meta( 'description' ) && ( true === $show_author_bio ) ) : ?>
<div class="author-bio">
	<div class="uk-grid uk-grid-collapse" data-uk-grid>
		<div class="uk-width-auto@s">
			<div class="author-avatar vcard">
				<?php echo get_avatar( get_the_author_meta( 'ID' ), 160 ); ?>
			</div>
		</div>
		<div class="uk-width-expand@s">
			<div class="author-info">
		        <h2 class="author-title uk-h5">
					<?php echo get_the_author(); ?>
				</h2>
				<?php echo wp_kses_post( wpautop( get_the_author_meta( 'description' ) ) ); ?>
				<a class="uk-button uk-button-small uk-button-text" href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author">
					<?php esc_html_e( 'All posts by author', 'basho' ); ?> <span data-uk-icon="icon: arrow-right;"></span>
				</a>
			</div>
		</div>
	</div>
</div><!-- .author-bio -->
<?php endif; ?>
