<?php
    if ( have_posts() ) :

        if ( is_home() && ! is_front_page() ) :
            ?>
            <header>
                <h2 class="page-title screen-reader-text"><?php single_post_title(); ?></h2>
            </header>
            <?php
        endif;
?>
    <?php
        $layout =   get_theme_mod( 'frannamag_blog_layout_setting', '1' );
    ?>
    <?php if ( $layout && $layout == '2' ): ?>
        <div class="blog-container">
    <?php elseif ( $layout && $layout == '3' ): ?>
        <div class="blog-container  blog-list">
    <?php elseif ( $layout && $layout == '4' ): ?>
        <div class="blog-container  grid-3-columns">
    <?php elseif ( $layout && $layout == '1' ): ?>
        <div class="blog-container default">
    <?php else: ?>
        <div class="blog-container default">
    <?php endif; ?>

        <?php

            /* Start the Loop */
            while ( have_posts() ) :
                the_post();

                /*
                * Include the Post-Type-specific template for the content.
                * If you want to override this in a child theme, then include a file
                * called content-___.php (where ___ is the Post Type name) and that will be used instead.
                */
                get_template_part( 'template-parts/content', get_post_type() );

            endwhile;

        ?>

        </div><!-- .blog-container -->

    <?php frannamag_posts_nav_main(); ?>

<?php
else :

    get_template_part( 'template-parts/content', 'none' );

endif;
?>
