<?php
/**
 * The template for displaying all single posts
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
 *
 * @package Journal_Blog
 */

get_header('single');

$jb_sidebar = get_theme_mod('journal_blog_sidebar_display','show');

 ?>

	<div id="primary" class="content-area">
		<main id="main" class="site-main <?php if ( $jb_sidebar == 'show' ){ ?> col-md-8 <?php } else { ?> col-md-12 <?php } ?>">

		<?php
		while ( have_posts() ) : the_post();

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

			// If comments are open or we have at least one comment, load up the comment template.
			if ( comments_open() || get_comments_number() ) :
				comments_template();
			endif;

		endwhile; // End of the loop.
		?>

		</main><!-- #main -->
		<?php if ( $jb_sidebar == 'show' ){ ?>
			<div class="col-md-4">
				<?php get_sidebar(); ?>
			</div>
		<?php } ?>
	</div><!-- #primary -->

<?php
get_footer('single');
