<?php
$bosa_business_firm_blogAdvertoneID = get_theme_mod( 'bosa_business_firm_blog_advert_one','');
$bosa_business_firm_blogAdverttwoID = get_theme_mod( 'bosa_business_firm_blog_advert_two','');       
$bosa_business_firm_blogAdvertthreeID = get_theme_mod( 'bosa_business_firm_blog_advert_three','');

$bosa_business_firm_Advert_array = array();
$bosa_business_firm_has_Advert = false;
if( !empty( $bosa_business_firm_blogAdvertoneID ) ){
	$bosa_business_firm_blog_advert_one  = wp_get_attachment_image_src( $bosa_business_firm_blogAdvertoneID,'bosa-business-firm-1370-550');
 	if ( is_array(  $bosa_business_firm_blog_advert_one ) ){
 		$bosa_business_firm_has_Advert = true;
   	 	$bosa_business_firm_blog_adverts_one = $bosa_business_firm_blog_advert_one[0];
   	 	$bosa_business_firm_Advert_array['image_one'] = array(
			'ID' => $bosa_business_firm_blog_adverts_one,
		);	
  	}
}
if( !empty( $bosa_business_firm_blogAdverttwoID ) ){
	$bosa_business_firm_blog_advert_two = wp_get_attachment_image_src( $bosa_business_firm_blogAdverttwoID,'bosa-business-firm-590-310');
	if ( is_array(  $bosa_business_firm_blog_advert_two ) ){
		$bosa_business_firm_has_Advert = true;	
        $bosa_business_firm_blog_adverts_two = $bosa_business_firm_blog_advert_two[0];
        $bosa_business_firm_Advert_array['image_two'] = array(
			'ID' => $bosa_business_firm_blog_adverts_two,
		);	
  	}
}
if( !empty( $bosa_business_firm_blogAdvertthreeID ) ){	
	$bosa_business_firm_blog_advert_three = wp_get_attachment_image_src( $bosa_business_firm_blogAdvertthreeID,'bosa-business-firm-590-310');
	if ( is_array(  $bosa_business_firm_blog_advert_three ) ){
		$bosa_business_firm_has_Advert = true;
      	$bosa_business_firm_blog_adverts_three = $bosa_business_firm_blog_advert_three[0];
      	$bosa_business_firm_Advert_array['image_three'] = array(
			'ID' => $bosa_business_firm_blog_adverts_three,
		);	
  	}
}

if( !get_theme_mod( 'bosa_business_firm_disable_advert_section', true ) && $bosa_business_firm_has_Advert ){ ?>
	<section class="section-advert-area">
		<div class="content-wrap">
			<?php foreach( $bosa_business_firm_Advert_array as $bosa_business_firm_each_Advert ){ ?>
				<article class="advert-content-wrap">
					<figure class= "featured-image">
						<img src="<?php echo esc_url( $bosa_business_firm_each_Advert['ID'] ); ?>">
					</figure>
				</article>
			<?php } ?>
		</div>
	</section>
<?php } 
