<?php
/**
 * The template for displaying featured content
 *
 * @package Personal_Trainer
 */
?>

<?php
$enable = get_theme_mod( 'personaltrainer_footer_contact_option', 'disabled' );

if ( ! personaltrainer_check_section( $enable ) ) {
	// Bail if featured content is disabled.
	return;
}

$post_id = get_theme_mod( 'personaltrainer_footer_contact_page' );

if ( $post_id &&  'publish' === get_post_status( $post_id ) ) {
	$post_object = get_post( $post_id );
	$title       = $post_object->post_title;
	$description = $post_object->post_content;
	$content     = get_the_post_thumbnail( $post_id, 'personaltrainer-contact-footer' );
} else {
	return;
}
?>

<div class="map-content-wrapper section">
	<div class="wrapper">
		<?php if ( $title ) : ?>
		<div class="section-heading-wrap">
			<h2 class="section-title"><?php echo wp_kses_data( $title ); ?></h2>
		</div><!-- .section-heading-wrap -->
		<?php endif; ?>

		<div class="section-content-wrap">
			<article id="map" class="post hentry post-demo">
				<div class="entry-container">
					<?php if ( $description ) : ?>
						<div class="entry-content">
							<p><?php echo wp_kses_post( $description ); ?></p>
						</div><!-- .entry-content -->
					<?php endif; ?>

					<figure class="google-maps">
						<?php echo wp_kses_post( apply_filters( 'the_content', $content ) ); ?>
					</figure>
				</div><!-- .entry-container -->
			</article> <!-- article -->
		</div><!-- .section-content-wrap -->
	</div><!-- .wrapper -->
</div> <!-- reserve-content-wrapper -->
