<?php
/**
 * The template for displaying 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 will use a different template.
 *
 * @package WordPress
 * @subpackage Twenty_Sixteen
 * @since Twenty Sixteen 1.0
 */

get_header(); ?>
<!-- JustinTest -->

<div id="primary" class="content-area container">
	<main id="main" class="site-main row" role="main">
		<?php if ( is_product_category() ): ?>
        <div class="col-md-4">
		<?php if ( is_active_sidebar( 'woo_left_sidebar' ) ) : ?>
            <div id="primary-sidebar" class="primary-sidebar widget-area" role="complementary">
                <?php dynamic_sidebar( 'woo_left_sidebar' ); ?>
            </div>
        <?php endif; ?>
        </div>
        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
            <?php if(ot_get_option('shop_banner') || get_field('category_banner')){
                ?>
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 no-padding shop-banner">
            <?php if(is_shop()){
                ?>
                <!-- is_shop -->
               <img class="img-resposive full-width" src="<?php echo ot_get_option('shop_banner'); ?>"> 
            <?php
                } ?>
            <?php if(is_product_category()){
                ?>
                <!-- is_product_category -->
               <img class="img-resposive full-width" src="<?php echo get_field('category_banner'); ?>"> 
            <?php
                } ?>
            </div>
            <?php
                } ?>
		<?php
		// Start the loop.
		while ( have_posts() ) : the_post();
?>
 <!-- Justin Posts -->
<?php
			// Include the page content template.
			get_template_part( 'template-parts/content', 'page' );

			// End of the loop.
		endwhile;
		?>
        <!-- looped over posts -->
		</div>
        <?php else: ?>
        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
            <?php if(ot_get_option('shop_banner') || get_field('category_banner')){
                ?>
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 no-padding shop-banner">
            <?php if(is_shop()){
                ?>
               <img class="img-resposive full-width" src="<?php echo ot_get_option('shop_banner'); ?>"> 
            <?php
                } ?>
            <?php if(is_product_category()){
                ?>
               <img class="img-resposive full-width" src="<?php echo get_field('category_banner'); ?>"> 
            <?php
                } ?>
            </div>
            <?php
                } ?>
		<?php
		// Start the loop.
		while ( have_posts() ) : the_post();

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

			// End of the loop.
		endwhile;
		?>
		</div>
        <?php endif; ?>
        
	</main><!-- .site-main -->

	<?php get_sidebar( 'content-bottom' ); ?>

</div><!-- .content-area -->

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