<?php
/**
 * Front Page
 * 
 * @package Excel_Business
 */

get_header(); 

$home_sections = excel_business_get_home_sections();

if ( 'posts' == get_option( 'show_on_front' ) ) { //Show Static Blog Page
    
    include( get_home_template() );
    get_sidebar();
    
}elseif( $home_sections ){ 
    
    //If all section are enabled then show custom home page.
    foreach( $home_sections as $section ){
        get_template_part( esc_attr( $section ) );  
    }
    
}else {
    //If all section are disabled then this respective page template. 
    include( get_page_template() );
    get_sidebar();
}

get_footer();