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


$singlestyle = get_theme_mod( 'equable_lite_single_style', 'single1' );
get_header(); ?>

<div id="content" class="site-content <?php echo esc_attr( $singlestyle ); ?>">

<?php if ( $singlestyle == 'single1')  : ?>
<div class="container">

	<div class="row">
		<div class="col-md-8">
			<main id="main" class="site-main <?php echo esc_attr( $singlestyle ); ?>">

				<?php				
				while ( have_posts() ) : the_post();	
					get_template_part( 'template-parts/post/content', 'single' );
				
					// Author bio.
					if ( is_single() && get_the_author_meta( 'description' ) && esc_attr(get_theme_mod( 'equable_lite_authorbio', 1 ) ) ) {
							get_template_part( 'author-bio' );
					}			
								
					// 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>
		</div>	

		<div class="col-md-4">
			<?php get_template_part( 'template-parts/sidebars/sidebar', 'right' ); ?>
		</div>

	</div>
</div>

<?php elseif ( $singlestyle == 'single2')  : ?>

<div class="container">

	<div class="row">
		<div class="col-md-8 order-md-2">
			<main id="main" class="site-main <?php echo esc_attr( $singlestyle ); ?>">

				<?php				
				while ( have_posts() ) : the_post();	
					get_template_part( 'template-parts/post/content', 'single' );
									
					// Author bio.
					if ( is_single() && get_the_author_meta( 'description' ) && esc_attr(get_theme_mod( 'equable_lite_authorbio', 1 ) ) ) {
							get_template_part( 'author-bio' );
					}			
								
					// 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>
		</div>	

		<div class="col-md-4 order-3 order-md-1">
			<?php get_template_part( 'template-parts/sidebars/sidebar', 'left' ); ?>
		</div>

	</div>
</div>

<?php else : ?>

<div class="container">

	<div class="row">
		<div class="col-md-12">
			<main id="main" class="site-main <?php echo esc_attr( $singlestyle ); ?>">

				<?php				
				while ( have_posts() ) : the_post();	
					get_template_part( 'template-parts/post/content', 'single' );
				
					// Author bio.
					if ( is_single() && get_the_author_meta( 'description' ) && esc_attr(get_theme_mod( 'equable_lite_authorbio', 1 ) ) ) {
							get_template_part( 'author-bio' );
					}			
								
					// 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>
		</div>
	</div>
</div>

<?php endif; ?>


<?php
get_footer();
