<?php
/**
 * Front page template with three selectable MuchWOW demos.
 *
 * @package Shabnam_MuchWOW
 */
defined( 'ABSPATH' ) || exit;

get_header();

$shabnam_front_id = (int) get_option( 'page_on_front' );
$shabnam_demo     = function_exists( 'shabnam_muchwow_selected_demo' ) ? shabnam_muchwow_selected_demo() : 'one';
$shabnam_use_elementor = $shabnam_front_id
	&& function_exists( 'shabnam_elementor_should_render_content' )
	&& shabnam_elementor_should_render_content( $shabnam_front_id );

if ( $shabnam_use_elementor ) :
	?>
	<div class="wrap shabnam-elementor-home shabnam-demo shabnam-demo-<?php echo esc_attr( $shabnam_demo ); ?>" id="wrapper">
		<?php
		$shabnam_front_page = get_post( $shabnam_front_id );
		if ( $shabnam_front_page instanceof WP_Post ) {
			setup_postdata( $shabnam_front_page );
			the_content();
			wp_reset_postdata();
		}
		?>
	</div>
	<?php
else :
	get_template_part( 'template-parts/front-page-demo', $shabnam_demo );
endif;

get_footer();
