<?php
/*
Template Name: Left Nav
*/
?>
<?php get_header(); ?>

<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">
        <aside class="subnav_cont sidebar">
          <div class="subnav">
            <?php 
             global $post;
  			 $post_id = $post->ID;
  			 $custom_menu_slug = get_post_meta($post_id,'truethemes_custom_sub_menu',true);
  			 	if(empty($custom_menu_slug)):
           			 wp_nav_menu( array('container' => false, 'theme_location' => 'Main Menu', 'walker' => new truethemes_sub_nav_walker()));
            	else:
            	     echo "<ul>";
           			 wp_nav_menu( array("container" => false, "menu" => "$custom_menu_slug", "walker" => new truethemes_sub_nav_walker_two()));
           			 echo "</ul>"; 
            	endif;
            ?>
          </div><!-- end subnav -->
          <?php
          
                //check for selected sidebar, does not print anything if none.
				$selected_sidebar = get_post_meta($post->ID, 'sbg_selected_sidebar_replacement', true);
					if(!empty($selected_sidebar[0])){
						 generated_dynamic_sidebar();
					}
          ?>
        </aside>
            
        <div class="page_content_right sub-content">
          <?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 of page_content-->
	</div><!-- END main-wrap -->
  
<?php get_footer(); ?>