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

get_header();
?>
<div class="container">

	<div class="row">
		<?php
			
			global $post;

			$buzz_agency_sidebar = get_post_meta($post->ID, 'buzz_agency_sidebar_layout', true);
			if ( empty( $buzz_agency_sidebar ) ){
				$buzz_agency_sidebar = 'right-sidebar';
			}
			$buzz_agency_custom_class = 'custom-col-8';
			if( 'no-sidebar' == $buzz_agency_sidebar ){
				$buzz_agency_custom_class = 'custom-col-12';
			} elseif ( 'both-sidebar' == $buzz_agency_sidebar ) {
				$buzz_agency_custom_class = 'custom-col-4';
			}else{
				$buzz_agency_custom_class = 'custom-col-8';
			}
			
			if($buzz_agency_sidebar=='both-sidebar' || $buzz_agency_sidebar=='left-sidebar'){
				get_sidebar('left');
			} 

			if($buzz_agency_sidebar=='both-sidebar' || $buzz_agency_sidebar=='right-sidebar'){
				get_sidebar();
			}
		?>

		<div id="primary" class="content-area <?php echo esc_attr( $buzz_agency_custom_class );?>  " >

			<main id="main" class="site-main">

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

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

					the_post_navigation();

				

					// 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 -->
		</div><!-- #primary -->
		
	</div>	

</div>

<?php get_footer();
