<?php
$bosa_business_agency_page_one 		= get_theme_mod( 'bosa_business_agency_blog_comment_page_one', '' );
$bosa_business_agency_page_two 		= get_theme_mod( 'bosa_business_agency_blog_comment_page_two', '' );
$bosa_business_agency_page_three 	= get_theme_mod( 'bosa_business_agency_blog_comment_page_three', '' );
$bosa_business_agency_page_four 	= get_theme_mod( 'bosa_business_agency_blog_comment_page_four', '' );
$bosa_business_agency_page_five		= get_theme_mod( 'bosa_business_agency_blog_comment_page_five', '' );
$bosa_business_agency_page_six 		= get_theme_mod( 'bosa_business_agency_blog_comment_page_six', '' );

$bosa_business_agency_page_array = array();
$bosa_business_agency_has_page = false;
if( !empty( $bosa_business_agency_page_one ) ){
	$bosa_business_agency_has_page = true;
	$bosa_business_agency_page_array['page_one'] = array(
		'ID' => $bosa_business_agency_page_one,
	);
}
if( !empty( $bosa_business_agency_page_two ) ){
	$bosa_business_agency_has_page = true;
	$bosa_business_agency_page_array['page_two'] = array(
		'ID' => $bosa_business_agency_page_two,
	);
}
if( !empty( $bosa_business_agency_page_three ) ){
	$bosa_business_agency_has_page = true;
	$bosa_business_agency_page_array['page_three'] = array(
		'ID' => $bosa_business_agency_page_three,
	);
}
if( !empty( $bosa_business_agency_page_four ) ){
	$bosa_business_agency_has_page = true;
	$bosa_business_agency_page_array['page_four'] = array(
		'ID' => $bosa_business_agency_page_four,
	);
}
if( !empty( $bosa_business_agency_page_five ) ){
	$bosa_business_agency_has_page = true;
	$bosa_business_agency_page_array['page_five'] = array(
		'ID' => $bosa_business_agency_page_five,
	);
}
if( !empty( $bosa_business_agency_page_six ) ){
	$bosa_business_agency_has_page = true;
	$bosa_business_agency_page_array['page_six'] = array(
		'ID' => $bosa_business_agency_page_six,
	);
}

if( !get_theme_mod( 'bosa_business_agency_disable_comments_section', true ) && $bosa_business_agency_has_page ){ ?>
	<section class="section-comments-area">
			<div class="row justify-content-center">
				<?php foreach( $bosa_business_agency_page_array as $bosa_business_agency_each_page ){ ?>
					<div class="col-sm-6 col-lg-4">
						<article class="comments-item">
							<h5 class="comments-content">	
								<?php 
								$bosa_business_agency_excerpt = get_the_excerpt( $bosa_business_agency_each_page[ 'ID' ] );
								$bosa_business_agency_result  = wp_trim_words( $bosa_business_agency_excerpt, 15, '' );
								echo esc_html( $bosa_business_agency_result );
								?>
							</h5>
							<div class="author-content">
								<figure class= "featured-image">
									<?php echo get_the_post_thumbnail( $bosa_business_agency_each_page[ 'ID' ], 'bosa-business-agency-420-300' ); ?>
								</figure>
								<h6 class="entry-title">
									<a href="<?php echo esc_url( get_permalink( $bosa_business_agency_each_page[ 'ID' ] ) ); ?>">
										<?php echo esc_html( get_the_title( $bosa_business_agency_each_page[ 'ID' ] ) ); ?>
									</a>
								</h6>	
							</div>
						</article>
					</div>
				<?php } ?>
			</div>
	</section>
<?php } ?>