<?php
/**
 * @link https://codex.wordpress.org/Template_Hierarchy
 *
 * @package SpiralLite One Page
 */

$enabled_sections = spiral_lite_one_page_get_sections();

if ( 'posts' == get_option( 'show_on_front' ) ) {
    include( get_home_template() );
}elseif( $enabled_sections ){ 
    get_header(); 

	 get_template_part( 'sections/section-hero' ); 

		 foreach( $enabled_sections as $section ){            
        if( ( $section['id'] == 'calltoaction' ) || ( $section['id'] == 'cta2' ) ){ ?>            
            <section id="<?php echo esc_attr( $section['id'] ); ?>" class="action">
                <div class="container">
				<div class="col-lg-12">
				<div class="row">
                    <?php get_template_part( 'sections/section', esc_attr( $section['id'] ) ); ?>
                </div><!-- End Row -->
		       </div><!-- End Column -->
			   </div><!-- End Container -->
            </section>  <!-- End Hero Section -->  
			
        <?php }elseif( $section['id'] == 'team' ) { ?>            
            <section id="<?php echo esc_attr( $section['id'] ); ?>" class="our-team">
                <div class="container">
                    <?php get_template_part( 'sections/section', esc_attr( $section['id'] ) ); ?>
                </div>
            </section>                
        <?php }elseif( $section['id'] == 'blog' ){ ?>            
            <section id="<?php echo esc_attr( $section['id'] ); ?>" class="blog-section">
                <div class="container">
                <div class="col-lg-12">
                <div class="row">
                    <?php get_template_part( 'sections/section', esc_attr( $section['id'] ) ); ?>
                </div>
				</div>
				</div>
            </section>                
        <?php }else{ ?>            
            <section id="<?php echo esc_attr( $section['id'] ); ?>" class="section">
                <div class="container">
					<div class="row">
						<div class="col-lg-12">
                    <?php get_template_part( 'sections/section', esc_attr( $section['id'] ) ); ?>
					</div> <!-- Column 12 -->
				</div> <!-- End Row -->
		        </div> <!-- End Container -->
            </section>  <!-- End Section -->              
        <?php
        } 
    }
    get_footer();
}else {
    include( get_page_template() );
}