<?php
/**
 * Front page – builder, home template, or customizer sections.
 *
 * @package EasySite_Pro
 */

get_header();

if ( is_front_page() ) {
	$front_id = (int) get_option( 'page_on_front' );
	if ( easysite_ve_active() && $front_id ) {
		echo '<article class="easysite-page easysite-page-builder-active">';
		easysite_render_page_builder( $front_id );
		echo '</article>';
	} elseif ( $front_id && easysite_page_uses_builder( $front_id ) ) {
		echo '<article class="easysite-page easysite-page-builder-active">';
		easysite_render_page_builder( $front_id );
		echo '</article>';
	} else {
		$template = locate_template( 'templates/template-home.php' );
		if ( $template ) {
			load_template( $template );
		} else {
			get_template_part( 'template-parts/content', 'home-sections' );
		}
	}
} else {
	get_template_part( 'template-parts/content', 'page' );
}

get_footer();
