<?php
$bosa_job_portal_blogAdvertoneID = get_theme_mod( 'bosa_job_portal_blog_advert_one','');
$bosa_job_portal_blogAdverttwoID = get_theme_mod( 'bosa_job_portal_blog_advert_two','');       
$bosa_job_portal_blogAdvertthreeID = get_theme_mod( 'bosa_job_portal_blog_advert_three','');
$bosa_job_portal_blogAdvertfourID = get_theme_mod( 'bosa_job_portal_blog_advert_four','');

$bosa_job_portal_Advert_array = array();
$bosa_job_portal_has_Advert = false;
if( !empty( $bosa_job_portal_blogAdvertoneID ) ){
	$bosa_job_portal_blog_advert_one  = wp_get_attachment_image_src( $bosa_job_portal_blogAdvertoneID,'bosa-job-portal-1370-550');
 	if ( is_array(  $bosa_job_portal_blog_advert_one ) ){
 		$bosa_job_portal_has_Advert = true;
   	 	$bosa_job_portal_blog_adverts_one = $bosa_job_portal_blog_advert_one[0];
   	 	$bosa_job_portal_Advert_array['image_one'] = array(
			'ID' => $bosa_job_portal_blog_adverts_one,
		);	
  	}
}
if( !empty( $bosa_job_portal_blogAdverttwoID ) ){
	$bosa_job_portal_blog_advert_two = wp_get_attachment_image_src( $bosa_job_portal_blogAdverttwoID,'bosa-job-portal-590-310');
	if ( is_array(  $bosa_job_portal_blog_advert_two ) ){
		$bosa_job_portal_has_Advert = true;	
        $bosa_job_portal_blog_adverts_two = $bosa_job_portal_blog_advert_two[0];
        $bosa_job_portal_Advert_array['image_two'] = array(
			'ID' => $bosa_job_portal_blog_adverts_two,
		);	
  	}
}
if( !empty( $bosa_job_portal_blogAdvertthreeID ) ){	
	$bosa_job_portal_blog_advert_three = wp_get_attachment_image_src( $bosa_job_portal_blogAdvertthreeID,'bosa-job-portal-590-310');
	if ( is_array(  $bosa_job_portal_blog_advert_three ) ){
		$bosa_job_portal_has_Advert = true;
      	$bosa_job_portal_blog_adverts_three = $bosa_job_portal_blog_advert_three[0];
      	$bosa_job_portal_Advert_array['image_three'] = array(
			'ID' => $bosa_job_portal_blog_adverts_three,
		);	
  	}
}

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