<?php
$bosa_logistics_blogAdvertoneID 	= get_theme_mod( 'bosa_logistics_blog_advert_one','');
$bosa_logistics_blogAdverttwoID 	= get_theme_mod( 'bosa_logistics_blog_advert_two','');       
$bosa_logistics_blogAdvertthreeID 	= get_theme_mod( 'bosa_logistics_blog_advert_three','');
$bosa_logistics_blogAdvertfourID 	= get_theme_mod( 'bosa_logistics_blog_advert_four','');

$bosa_logistics_Advert_array = array();
$bosa_logistics_has_Advert = false;
if( !empty( $bosa_logistics_blogAdvertoneID ) ){
	$bosa_logistics_blog_advertisement_one  = wp_get_attachment_image_src( $bosa_logistics_blogAdvertoneID,'bosa-logistics-1370-550');
 	if ( is_array(  $bosa_logistics_blog_advertisement_one ) ){
 		$bosa_logistics_has_Advert = true;
   	 	$bosa_logistics_blog_advertisements_one = $bosa_logistics_blog_advertisement_one[0];
   	 	$bosa_logistics_Advert_array['image_one'] = array(
			'ID' => $bosa_logistics_blog_advertisements_one,
		);	
  	}
}
if( !empty( $bosa_logistics_blogAdverttwoID ) ){
	$bosa_logistics_blog_advertisement_two = wp_get_attachment_image_src( $bosa_logistics_blogAdverttwoID,'bosa-logistics-420-300');
	if ( is_array(  $bosa_logistics_blog_advertisement_two ) ){
		$bosa_logistics_has_Advert = true;	
        $bosa_logistics_blog_advertisements_two = $bosa_logistics_blog_advertisement_two[0];
        $bosa_logistics_Advert_array['image_two'] = array(
			'ID' => $bosa_logistics_blog_advertisements_two,
		);	
  	}
}
if( !empty( $bosa_logistics_blogAdvertthreeID ) ){	
	$bosa_logistics_blog_advertisement_three = wp_get_attachment_image_src( $bosa_logistics_blogAdvertthreeID,'bosa-logistics-420-300');
	if ( is_array(  $bosa_logistics_blog_advertisement_three ) ){
		$bosa_logistics_has_Advert = true;
      	$bosa_logistics_blog_advertisements_three = $bosa_logistics_blog_advertisement_three[0];
      	$bosa_logistics_Advert_array['image_three'] = array(
			'ID' => $bosa_logistics_blog_advertisements_three,
		);	
  	}
}
if( !empty( $bosa_logistics_blogAdvertfourID ) ){	
	$bosa_logistics_blog_advertisement_four = wp_get_attachment_image_src( $bosa_logistics_blogAdvertfourID,'bosa-logistics-420-300');
	if ( is_array(  $bosa_logistics_blog_advertisement_four ) ){
		$bosa_logistics_has_Advert = true;
      	$bosa_logistics_blog_advertisements_four = $bosa_logistics_blog_advertisement_four[0];
      	$bosa_logistics_Advert_array['image_four'] = array(
			'ID' => $bosa_logistics_blog_advertisements_four,
		);	
  	}
}

if( !get_theme_mod( 'bosa_logistics_disable_adverts_section', true ) && $bosa_logistics_has_Advert ){ ?>
	<section class="section-advertisement-area">
		<div class="content-wrap">
			<?php foreach( $bosa_logistics_Advert_array as $bosa_logistics_each_Advert ){ ?>
				<figure class= "featured-image">
					<img src="<?php echo esc_url( $bosa_logistics_each_Advert['ID'] ); ?>">
				</figure>
			<?php } ?>
		</div>
	</section>
<?php } 
