<?php
/**
 * Displaying all single posts.
 * @package Solar Power
 */

get_header(); ?>

<main id="main" role="main">
	<?php do_action( 'solar_power_single_header' ); ?>
		<div class="container">
		    <div class="wrapper">
			    <?php
			        $solar_power_layout = get_theme_mod( 'solar_power_theme_options','Right Sidebar');
			        if($solar_power_layout == 'Left Sidebar'){?>
					<div class="row">
						<div class="col-lg-4 col-md-4" id="sidebar"><?php dynamic_sidebar('sidebar-1'); ?></div>
						<div class="singlebox" id="main-content">
							<?php if ( have_posts() ) :
								/* Start the Loop */
								while ( have_posts() ) : the_post();
								get_template_part( 'template-parts/post/single-content' ); 
								endwhile;
								else :
								get_template_part( 'no-results' ); 
								endif; 
							?>
						</div>
					</div>
		       		<?php }else if($solar_power_layout == 'Right Sidebar'){?>
		       			<div class="row">
					       	<div class="col-lg-8 col-md-8 singlebox" id="main-content">
								<?php if ( have_posts() ) :
					              	/* Start the Loop */
					                while ( have_posts() ) : the_post();
					                  get_template_part( 'template-parts/post/single-content' ); 
					                endwhile;
					                else :
					                  get_template_part( 'no-results' ); 
					                endif; 
			            		?>
					       	</div>
							<div class="col-lg-4 col-md-4" id="sidebar"><?php dynamic_sidebar('sidebar-1'); ?></div>
						</div>
					<?php }else if($solar_power_layout == 'One Column'){?>
							<div class="col-lg-12 col-md-12 singlebox" id="main-content">
								<?php if ( have_posts() ) :
					              	/* Start the Loop */
					                while ( have_posts() ) : the_post();
					                  get_template_part( 'template-parts/post/single-content' ); 
					                endwhile;
					                else :
					                  get_template_part( 'no-results' ); 
					                endif; 
			            		?>
					    	</div>
				<?php } ?>
		    </div>
		</div>
	<?php do_action( 'solar_power_single_footer' ); ?>
</main>

<?php get_footer(); ?>