<?php
/**
 * Template for displaying content in the loop.
 */
?>

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

        get_template_part( 'partials/featured-image' );

        basho_the_post_meta( get_the_ID(), 'archive-entry-header' );

        ?>

        <header class="archive-entry-header">
            <?php

            the_title( sprintf( '<h2 class="uk-h2 entry-title"><a class="uk-link-text" href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' );

            if ( is_sticky() && is_home() && ! is_paged() ) {
                printf( '<span class="sticky-post">%s</span>', esc_attr_x( 'Featured', 'post', 'basho' ) );
            }

            ?>
        </header>

        <?php

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

    	if ( true === $show_excerpt && has_excerpt() ) {
            ?>

            <div class="archive-entry-content">
                <?php the_excerpt(); ?>
            </div>

            <?php
        }

        basho_the_post_meta( get_the_ID(), 'archive-entry-footer' );

        ?>

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