<?php
/**
 * This file adds the Home Page to the Executive Pro Theme.
 *
 * @author StudioPress
 * @package Generate
 * @subpackage Customizations
 */
  ?>

<?php

 get_header(); ?>
</div></div>

<div id="banner"><div class="site-container">
<?php dynamic_sidebar( 'home-top' ); ?>

<div class="social-area"><?php dynamic_sidebar( 'social-area' ); ?></div>

</div></div>

<div id="content-area" class="middle-container"><div class="site-container">
	<?php dynamic_sidebar( 'home-middle' ); ?>
</div></div>

<?php add_action( 'genesis_meta', 'executive_home_genesis_meta' );
/**
 * Add widget support for homepage. If no widgets active, display the default loop.
 *
 */
function executive_home_genesis_meta() {

	if ( is_active_sidebar( 'home-slider' ) || is_active_sidebar( 'home-top' ) || is_active_sidebar( 'home-cta' ) || is_active_sidebar( 'home-middle' ) ) {

		remove_action( 'genesis_loop', 'genesis_do_loop' );
		add_action( 'genesis_loop', 'executive_home_sections' );
		add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
		add_filter( 'body_class', 'executive_add_home_body_class' );

	}
	
}

function executive_home_sections() {

	genesis_widget_area( 'home-slider', array(
		'before' => '<div class="home-slider widget-area">',
		'after'  => '</div>',
	) );

 

	genesis_widget_area( 'home-cta', array(
		'before' => '<div class="home-cta widget-area">',
		'after'  => '</div>',
	) );
 
	
}

//* Add body class to home page		
function executive_add_home_body_class( $classes ) {

	$classes[] = 'executive-pro-home';
	return $classes;
	
} ?>

<div class="form-area"><div class="site-container"><?php dynamic_sidebar( 'home-form' ); ?></div></div>

<div class="social-bottom"><div class="site-container"><?php dynamic_sidebar( 'social-bottom' ); ?></div></div>

<?php get_footer(); ?>
