<?php
/**
 * Template part for displaying home special page section
 *
 * @package Education_Soul
 */

$special_title = education_soul_get_option( 'special_title' );
$special_page  = education_soul_get_option( 'special_page' );
?>

<div id="education-soul-special-page" class="home-section home-section-special-page">
	<div class="container">
		<?php if ( ! empty( $special_title ) ) : ?>
			<h2 class="section-title"><?php echo esc_html( $special_title ); ?></h2>
		<?php endif; ?>

		<?php if ( absint( $special_page ) > 0 ) : ?>
			<?php
			$qargs = array(
				'posts_per_page' => 1,
				'post_type'      => 'page',
				'p'              => $special_page,
			);

			$the_query = new WP_Query( $qargs );
			?>

			<?php if ( $the_query->have_posts() ) : ?>
				<?php
				while ( $the_query->have_posts() ) :
					$the_query->the_post();
					?>
					<?php the_content(); ?>
				<?php endwhile; ?>
				<?php wp_reset_postdata(); ?>
			<?php endif; ?>
		<?php endif; ?>
	</div><!-- .container -->
</div><!-- .home-section-special-page -->
