<?php
$bosa_it_services_page_one 	= get_theme_mod( 'bosa_it_services_blog_memorable_moments_page_one', '' );
$bosa_it_services_page_two 	= get_theme_mod( 'bosa_it_services_blog_memorable_moments_page_two', '' );
$bosa_it_services_page_three = get_theme_mod( 'bosa_it_services_blog_memorable_moments_page_three', '' );
$bosa_it_services_page_four  = get_theme_mod( 'bosa_it_services_blog_memorable_moments_page_four', '' );

$bosa_it_services_page_array = array();
$bosa_it_services_has_page = false;
$bosa_it_services_has_array = false;

if( !empty( $bosa_it_services_page_one ) ){
	$bosa_it_services_has_page = true;
	$bosa_it_services_has_array = true;
	$bosa_it_services_page_array['page_one'] = array(
		'ID' => $bosa_it_services_page_one,
	);
}
if( !empty( $bosa_it_services_page_two ) ){
	$bosa_it_services_has_page = true;
	$bosa_it_services_has_array = true;
	$bosa_it_services_page_array['page_two'] = array(
		'ID' => $bosa_it_services_page_two,
	);
}
if( !empty( $bosa_it_services_page_three ) ){
	$bosa_it_services_has_page = true;
	$bosa_it_services_has_array = true;
	$bosa_it_services_page_array['page_three'] = array(
		'ID' => $bosa_it_services_page_three,
	);
}
if( !empty( $bosa_it_services_page_four ) ){
	$bosa_it_services_has_page = true;
	$bosa_it_services_has_array = true;
	$bosa_it_services_page_array['page_four'] = array(
		'ID' => $bosa_it_services_page_four,
	);
}

if( !get_theme_mod( 'bosa_it_services_disable_memorable_moments_section', true ) && $bosa_it_services_has_page ){ ?>
	<section class="section-memorable-moments-area">
		<?php if ( $bosa_it_services_has_array ){ ?>
			<div class="row justify-content-center">
				<?php foreach( $bosa_it_services_page_array as $bosa_it_services_each_page ){ ?>
					<div class="col-lg-4 col-sm-6 px-4">
						<div class="event-wrapper">
							<article class="event-iconbox">
								<div class="patten-overlay">
									<i class="fas fa-braille"></i>
								</div>
								<div class="patten-overlay-bottom">
									<i class="fas fa-braille"></i>
								</div>
								<div class="event-icon">
									<i class="far fa-calendar-check"></i>
								</div>
								<div class="entry-content">
									<h3 class="entry-title">
										<a href="<?php echo esc_url( get_permalink( $bosa_it_services_each_page[ 'ID' ] ) ); ?>">
											<?php echo esc_html( get_the_title( $bosa_it_services_each_page[ 'ID' ] ) ); ?>
										</a>
									</h3>
									<div class="entry-text">
										<?php 
										$bosa_it_services_excerpt = get_the_excerpt( $bosa_it_services_each_page[ 'ID' ] );
										$bosa_it_services_result  = wp_trim_words( $bosa_it_services_excerpt, 15, '' );
										echo esc_html( $bosa_it_services_result );
										?>
									</div>
								</div>
								<div class="event-link-wrap">
									<a href="<?php echo esc_url( get_permalink( $bosa_it_services_each_page[ 'ID' ] ) ); ?>" class="event-page-link">
										<i class="fas fa-plus"></i>
									</a>
								</div>
							</article>
						</div>
					</div>
				<?php } ?>
			</div>
		<?php } ?>
	</section>	
<?php } 