<?php
/**
 * The default template for displaying content.
 */
?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

	<?php

	get_template_part( 'partials/entry-header' );

	if ( ! is_search() ) {
		get_template_part( 'partials/featured-image' );
	}

	?>

	<div class="entry-content-wrapper">

		<div class="entry-content">

			<?php

			if ( ( is_search() && has_excerpt() ) || ! is_singular() ) {
				the_excerpt();
			} else {
				the_content( __( 'Continue reading', 'basho' ) );
			}

			?>

		</div> <!-- .entry-content -->

	</div> <!-- .entry-content-wrapper -->

	<div class="entry-footer">
		<?php

		wp_link_pages(
			array(
				'before'      => '<div class="uk-link-text uk-text-bold"><nav class="post-nav-links" aria-label="' . esc_attr__( 'Page', 'basho' ) . '"><span class="label">' . __( 'Pages:', 'basho' ) . '</span>',
				'after'       => '</nav></div>',
				'link_before' => '<span class="page-number">',
				'link_after'  => '</span>',
			)
		);

		edit_post_link( __( 'Edit', 'basho' ), '<div class="edit-link-wrapper">', ' <span aria-hidden="true"><span data-uk-icon="icon: basho-edit; ratio: .55"></span></span></div>', null, 'uk-link' );

		// Entry footer post meta.
		basho_the_post_meta( get_the_ID(), 'entry-footer' );

		if ( is_single() ) {

			get_template_part( 'partials/entry-author-bio' );

			get_template_part( 'partials/navigation' );

		}

		?>
	</div> <!-- .entry-footer -->

	<?php

	/**
	 * Output comments wrapper if it's a post, or if comments are open,
	 * or if there's a comment number – and check for password.
	 * */
	if ( ( is_single() || is_page() ) && ( comments_open() || get_comments_number() ) && ! post_password_required() ) {
		?>

		<div class="comments-wrapper">

			<?php comments_template(); ?>

		</div> <!-- .comments-wrapper -->

		<?php
	}

	?>

</article> <!-- #post-<?php the_ID(); ?> -->
