<?php
/**
* The header for our theme.
*
* This is the template that displays all of the <head> section and everything up until <div id="content">
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package Theme Palace
* @subpackage Enlightme
* @since Enlightme 1.0.0
*/

/**
* enlightme_doctype hook
*
* @hooked enlightme_doctype -  10
*
*/
do_action( 'enlightme_doctype' );

?>
<head>
	<?php
/**
* enlightme_before_wp_head hook
*
* @hooked enlightme_head -  10
*
*/
do_action( 'enlightme_before_wp_head' );

wp_head(); 
?>
</head>

<body <?php body_class(); ?>>

	<?php do_action( 'wp_body_open' ); ?>

	<?php
/**
* enlightme_page_start_action hook
*
* @hooked enlightme_page_start -  10
*
*/
do_action( 'enlightme_page_start_action' ); 

/**
* enlightme_loader_action hook
*
* @hooked enlightme_loader -  10
*
*/
do_action( 'enlightme_before_header' );

/**
* enlightme_header_action hook
*
* @hooked enlightme_header_start -  10
* @hooked enlightme_site_branding -  20
* @hooked enlightme_site_navigation -  30
* @hooked enlightme_header_end -  50
*
*/
do_action( 'enlightme_header_action' );

/**
* enlightme_content_start_action hook
*
* @hooked enlightme_content_start -  10
*
*/
do_action( 'enlightme_content_start_action' );

/**
* enlightme_header_image_action hook
*
* @hooked enlightme_header_image -  10
*
*/
do_action( 'enlightme_header_image_action' );

if ( enlightme_is_frontpage() ) {
	$options = enlightme_get_theme_options();
	$sorted = array();
	$sorted = explode( ',' , enlightme_get_homepage_sections() );

	foreach ( $sorted as $section ) {
		add_action( 'enlightme_primary_content', 'enlightme_add_'. $section .'_section' );
	}

	do_action( 'enlightme_primary_content' );
}