<?php
/**
 * Template for posts page
 *
 * @package Blorigan
 */

get_header();
?>

	<div id="primary" class="content-area">
		<main id="main" class="site-main" role="main">

			<?php if ( have_posts() ) : ?>

				<?php
				$archive_layout = blorigan_get_option( 'archive_layout' );

				if ( 'grid' === $archive_layout ) {
					echo '<div class="masonry-outer"><div id="masonry-main">';
				}

				while ( have_posts() ) :
					the_post();

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

				endwhile;

				if ( 'grid' === $archive_layout ) {
					echo '</div><!-- #masonry-main --></div><!-- .masonry-outer -->';
				}
				?>

				<?php
				/**
				 * Hook - blorigan_action_posts_navigation.
				 *
				 * @hooked: blorigan_custom_posts_navigation - 10
				 */
				do_action( 'blorigan_action_posts_navigation' );
				?>

			<?php else : ?>

				<?php get_template_part( 'template-parts/content', 'none' ); ?>

			<?php endif; ?>

		</main><!-- #main -->
	</div><!-- #primary -->

<?php
/**
 * Hook - blorigan_action_sidebar.
 *
 * @hooked: blorigan_add_sidebar - 10
 */
do_action( 'blorigan_action_sidebar' );

get_footer();
