<?php
$bosa_influencer_marketing_page_one 	= get_theme_mod( 'bosa_influencer_marketing_reviews_page_one', '' );
$bosa_influencer_marketing_page_two 	= get_theme_mod( 'bosa_influencer_marketing_reviews_page_two', '' );
$bosa_influencer_marketing_page_three	= get_theme_mod( 'bosa_influencer_marketing_reviews_page_three', '' );

$bosa_influencer_marketing_page_array = array();
$bosa_influencer_marketing_has_page = false;
if( !empty( $bosa_influencer_marketing_page_one ) ){
	$bosa_influencer_marketing_has_page = true;
	$bosa_influencer_marketing_page_array['page_one'] = array(
		'ID' => $bosa_influencer_marketing_page_one,
	);
}
if( !empty( $bosa_influencer_marketing_page_two ) ){
	$bosa_influencer_marketing_has_page = true;
	$bosa_influencer_marketing_page_array['page_two'] = array(
		'ID' => $bosa_influencer_marketing_page_two,
	);
}
if( !empty( $bosa_influencer_marketing_page_three ) ){
	$bosa_influencer_marketing_has_page = true;
	$bosa_influencer_marketing_page_array['page_three'] = array(
		'ID' => $bosa_influencer_marketing_page_three,
	);
}

if( !get_theme_mod( 'bosa_influencer_marketing_disable_reviews_section', true ) && $bosa_influencer_marketing_has_page ){ ?>
	<section class="section-reviews-area">
			<div class="row justify-content-center">
				<?php foreach( $bosa_influencer_marketing_page_array as $bosa_influencer_marketing_each_page ){ ?>
					<div class="col-sm-6 col-lg-4">
						<article class="reviews-item">
							<div class="author-content">
								<h3 class="entry-title">
									<a href="<?php echo esc_url( get_permalink( $bosa_influencer_marketing_each_page[ 'ID' ] ) ); ?>">
										<?php echo esc_html( get_the_title( $bosa_influencer_marketing_each_page[ 'ID' ] ) ); ?>
									</a>
								</h3>	
								<div class="rating-stars d-flex mb-1 align-item-center">
									<i class="fa-solid fa-star"></i>
									<i class="fa-solid fa-star"></i>
									<i class="fa-solid fa-star"></i>
									<i class="fa-solid fa-star"></i>
									<i class="fa-solid fa-star"></i>
								</div>
								<p class="entry-text">	
									<?php 
									$bosa_influencer_marketing_excerpt = get_the_excerpt( $bosa_influencer_marketing_each_page[ 'ID' ] );
									$bosa_influencer_marketing_result  = wp_trim_words( $bosa_influencer_marketing_excerpt, 10, '' );
									echo esc_html( $bosa_influencer_marketing_result );
									?>
								</p>
							</div>
							<figure class= "featured-image">
								<?php echo get_the_post_thumbnail( $bosa_influencer_marketing_each_page[ 'ID' ], 'bosa-influencer-marketing-420-300' ); ?>
							</figure>
						</article>
					</div>
				<?php } ?>
			</div>
	</section>
<?php } 