<?php
$bosa_real_estate_group_page_one 	= get_theme_mod( 'bosa_real_estate_group_testimonials_page_one', '' );
$bosa_real_estate_group_page_two 	= get_theme_mod( 'bosa_real_estate_group_testimonials_page_two', '' );
$bosa_real_estate_group_page_three = get_theme_mod( 'bosa_real_estate_group_testimonials_page_three', '' );

$bosa_real_estate_group_page_array = array();
$bosa_real_estate_group_has_page = false;
if( !empty( $bosa_real_estate_group_page_one ) ){
	$bosa_real_estate_group_has_page = true;
	$bosa_real_estate_group_page_array['page_one'] = array(
		'ID' => $bosa_real_estate_group_page_one,
	);
}
if( !empty( $bosa_real_estate_group_page_two ) ){
	$bosa_real_estate_group_has_page = true;
	$bosa_real_estate_group_page_array['page_two'] = array(
		'ID' => $bosa_real_estate_group_page_two,
	);
}
if( !empty( $bosa_real_estate_group_page_three ) ){
	$bosa_real_estate_group_has_page = true;
	$bosa_real_estate_group_page_array['page_three'] = array(
		'ID' => $bosa_real_estate_group_page_three,
	);
}

if( !get_theme_mod( 'bosa_real_estate_group_disable_testimonials_section', true ) && $bosa_real_estate_group_has_page ){ ?>
	<section class="section-testimonials-area ">
			<div class="row justify-content-center">
				<?php foreach( $bosa_real_estate_group_page_array as $bosa_real_estate_group_each_page ){ ?>
					<div class="col-sm-6 col-lg-4">
						<article class="testimonials-item">
							<figure class= "featured-image">
								<?php echo get_the_post_thumbnail( $bosa_real_estate_group_each_page[ 'ID' ], 'bosa-real-estate-group-420-300' ); ?>
							</figure>
							<div class="author-content">
								<h5 class="testimonials-content">	
									<?php 
									$bosa_real_estate_group_excerpt = get_the_excerpt( $bosa_real_estate_group_each_page[ 'ID' ] );
									$bosa_real_estate_group_result  = wp_trim_words( $bosa_real_estate_group_excerpt, 20, '' );
									echo esc_html( $bosa_real_estate_group_result );
									?>
								</h5>
								<h3 class="entry-title">
									<a href="<?php echo esc_url( get_permalink( $bosa_real_estate_group_each_page[ 'ID' ] ) ); ?>">
										<?php echo esc_html( get_the_title( $bosa_real_estate_group_each_page[ 'ID' ] ) ); ?>
									</a>
								</h3>	
							</div>
						</article>
					</div>
				<?php } ?>
			</div>
	</section>
<?php } 