<?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://codex.wordpress.org/Template_Hierarchy
 *
 * @package Wacko
 */

get_header();

$theme_options  = wacko_theme_options();

	if (( get_option( 'show_on_front' ) == 'posts' ) || ( 1 == $theme_options['home_content']) || (is_page() && !is_front_page() )) {
	?>

	 <div class="content-wrapper">
        <div id="content" class="container">
            <div class="row">

            	<?php if( 'left' == $theme_options['sidebar'] ) { ?>

                    <section id="primary" class="col-xs-12 col-sm-8 col-md-8 primary-wrapper left-sidebar">

                    <?php } elseif( 'no_side' == $theme_options['sidebar'] ) { ?>

                    <section id="primary" class="col-xs-12 col-sm-12 col-md-12 primary-wrapper">
					
					<?php } else { ?>

					<section id="primary" class="col-xs-12 col-sm-8 col-md-8 primary-wrapper">

                <?php } ?>
                
                  <div id="main" class="site-main" role="main">

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

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

				// 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.
			?>

		</div><!--main-->
    </section><!--left-list-wrap-->

<?php
get_sidebar(); ?>

		</div><!--row-->
    </div><!--container-->
</div><!--wrapper-list--> 

<?php
}
get_footer();
