<?php
$bosa_bakery_page_one 	= get_theme_mod( 'bosa_bakery_feedbacks_page_one', '' );
$bosa_bakery_page_two 	= get_theme_mod( 'bosa_bakery_feedbacks_page_two', '' );
$bosa_bakery_page_three	= get_theme_mod( 'bosa_bakery_feedbacks_page_three', '' );

$bosa_bakery_page_array = array();
$bosa_bakery_has_page = false;
if( !empty( $bosa_bakery_page_one ) ){
	$bosa_bakery_has_page = true;
	$bosa_bakery_page_array['page_one'] = array(
		'ID' => $bosa_bakery_page_one,
	);
}
if( !empty( $bosa_bakery_page_two ) ){
	$bosa_bakery_has_page = true;
	$bosa_bakery_page_array['page_two'] = array(
		'ID' => $bosa_bakery_page_two,
	);
}
if( !empty( $bosa_bakery_page_three ) ){
	$bosa_bakery_has_page = true;
	$bosa_bakery_page_array['page_three'] = array(
		'ID' => $bosa_bakery_page_three,
	);
}

if( !get_theme_mod( 'bosa_bakery_disable_feedbacks_section', true ) && $bosa_bakery_has_page ){ ?>
	<section class="section-feedbacks-area">
			<div class="row justify-content-center">
				<?php foreach( $bosa_bakery_page_array as $bosa_bakery_each_page ){ ?>
					<div class="col-sm-6 col-lg-4">
						<article class="feedbacks-item">
							<div class="author-content">
								<h3 class="entry-title">
									<a href="<?php echo esc_url( get_permalink( $bosa_bakery_each_page[ 'ID' ] ) ); ?>">
										<?php echo esc_html( get_the_title( $bosa_bakery_each_page[ 'ID' ] ) ); ?>
									</a>
								</h3>	
								<p class="entry-text">	
									<?php 
									$bosa_bakery_excerpt = get_the_excerpt( $bosa_bakery_each_page[ 'ID' ] );
									$bosa_bakery_result  = wp_trim_words( $bosa_bakery_excerpt, 10, '' );
									echo esc_html( $bosa_bakery_result );
									?>
								</p>
							</div>
							<figure class= "featured-image">
								<?php echo get_the_post_thumbnail( $bosa_bakery_each_page[ 'ID' ], 'bosa-bakery-420-300' ); ?>
							</figure>
						</article>
					</div>
				<?php } ?>
			</div>
	</section>
<?php } 