<?php
/**
 * The template for displaying single posts.
 *
 * @link https://codex.wordpress.org/Template_Hierarchy
 *
 * @package leatherhouse
 */

if ( ! defined( 'ABSPATH' ) ) {
    exit; // Exit if accessed directly.
}

get_header();
?>
<section id="post-section" class="post-section av-py-default">
	<div class="av-container">
		<div class="av-columns-area">

			<?php
			$leatherhouse_single_blog_pages_layout = get_theme_mod( 'leatherhouse_single_blog_pages_layout', 'leatherhouse_right_sidebar' );
			if ( 'leatherhouse_left_sidebar' === $leatherhouse_single_blog_pages_layout ) :
				get_sidebar();
				endif;
			?>

            <div id="av-primary-content" class="<?php echo esc_attr( leatherhouse_single_post_layout() ); ?>">

				<?php if ( have_posts() ) : ?>
					<?php while ( have_posts() ) : the_post(); ?>
						<?php get_template_part( 'template-parts/content/content', 'single' ); ?>
					<?php endwhile; ?>
				<?php endif; ?>

				<?php
				if ( comments_open() || get_comments_number() ) {
					comments_template();
				}
				?>

			</div>

			<?php if ( 'leatherhouse_right_sidebar' === $leatherhouse_single_blog_pages_layout ) : 
				 get_sidebar(); 
				 endif; 
			?>

		</div>
	</div>
</section>
<?php get_footer(); ?>
