<?php
/**
 * The template for displaying all pages
 *
 * This is the template that displays all pages by default.
 * Please note that this is the WordPress construct of pages
 * and that other 'pages' on your WordPress site may use a
 * different template.
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 * @package bootstrap_coach
 */

get_header();

$layout = bootstrap_coach_get_sidebar_layout();
if( $layout == 'no-sidebar' ) {
  $content_column_class = 'col-sm-12';
} else {
  $content_column_class = 'col-sm-8';
}
?>

<div class="inside-page" id="primary">
<div class="container">
	<div class="row">

		<?php if ( $layout == 'left-sidebar' ) : ?>
      <div class="col-sm-4"><?php get_sidebar(); ?></div>
    <?php endif; ?>

    <div class="<?php echo esc_attr( $content_column_class ); ?>">
			<section class="page-section">
				<div class="detail-content">            
	        <?php while ( have_posts() ) : the_post(); ?>
	          <?php get_template_part( 'template-parts/content', 'page' ); ?>   
	        <?php endwhile; // End of the loop. ?> 
		        <?php comments_template(); ?>         
		     </div> <!-- /.end of detail-content -->	
			</section><!-- /.end of section -->
		</div>

		<?php if( $layout == 'right-sidebar' ) : ?>
	    <div class="col-sm-4"><?php get_sidebar(); ?></div>
	  <?php endif; ?>

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