<?php get_header(); ?>

<?php 
// check for WooCommerce. If true, load WooCommerce custom layout
if (class_exists('woocommerce') && ((is_woocommerce() == "true") || (is_checkout() == "true") || (is_cart() == "true") || (is_account_page() == "true") )){ ?>


 <section class="small_banner">
  <?php get_template_part('template-part-woocommerce-banner','childtheme'); ?>
  </section>

<section id="content-container" class="clearfix tt-woocommerce">
  <div id="main-wrap" class="clearfix">
  	<div class="page_content">
		<?php if(have_posts()) : while(have_posts()) : the_post(); the_content(); truethemes_link_pages(); endwhile;endif; ?>
    </div><!-- END page_content -->
    
    <aside class="sidebar right-sidebar">
		<?php 
		if ( (is_cart() == "true") || (is_checkout() == "true") ) {
			dynamic_sidebar("WooCommerce - Cart + Checkout");
		} else {
			dynamic_sidebar("WooCommerce Sidebar");
		}
		?>
	</aside><!-- END sidebar-->
  </div><!-- END main-wrap -->
  
  
  <?php // ELSE load default layout
  } else { ?>
  
  
<section class="small_banner">
<?php get_template_part('template-part-small-banner','childtheme'); ?>
</section>

<section id="content-container" class="clearfix">
<div id="main-wrap" class="clearfix">
<?php get_template_part('template-part-page-banner','childtheme');
if(have_posts()) : while(have_posts()) : the_post(); the_content(); truethemes_link_pages(); endwhile;endif; ?>
<?php get_template_part('template-part-inline-editing','childtheme'); ?>
</div><!-- END main-wrap --> 
  
  
  <?php // END WooCommerce loop
  } ?>
    
<?php get_footer(); ?>