<?php
$bosa_preschool_blogpartneroneID 	= get_theme_mod( 'bosa_preschool_blog_partner_one','' );
$bosa_preschool_blogpartnertwoID 	= get_theme_mod( 'bosa_preschool_blog_partner_two','' );       
$bosa_preschool_blogpartnerthreeID 	= get_theme_mod( 'bosa_preschool_blog_partner_three','' );
$bosa_preschool_blogpartnerfourID 	= get_theme_mod( 'bosa_preschool_blog_partner_four','' );
$bosa_preschool_blogpartnerfiveID 	= get_theme_mod( 'bosa_preschool_blog_partner_five','' );
$bosa_preschool_blogpartnersixID 	= get_theme_mod( 'bosa_preschool_blog_partner_six','' );

$bosa_preschool_partner_array = array();
$bosa_preschool_has_partner = false;
if( !empty( $bosa_preschool_blogpartneroneID ) ){
	$bosa_preschool_blog_partner_one  = wp_get_attachment_image_src( $bosa_preschool_blogpartneroneID,'bosa-preschool-420-300');
 	if ( is_array(  $bosa_preschool_blog_partner_one ) ){
 		$bosa_preschool_has_partner = true;
   	 	$bosa_preschool_blog_partner_one = $bosa_preschool_blog_partner_one[0];
   	 	$bosa_preschool_partner_array['image_one'] = array(
			'ID' => $bosa_preschool_blog_partner_one,
		);	
  	}
}
if( !empty( $bosa_preschool_blogpartnertwoID ) ){
	$bosa_preschool_blog_partner_two = wp_get_attachment_image_src( $bosa_preschool_blogpartnertwoID,'bosa-preschool-420-300');
	if ( is_array(  $bosa_preschool_blog_partner_two ) ){
		$bosa_preschool_has_partner = true;	
        $bosa_preschool_blog_partner_two = $bosa_preschool_blog_partner_two[0];
        $bosa_preschool_partner_array['image_two'] = array(
			'ID' => $bosa_preschool_blog_partner_two,
		);	
  	}
}
if( !empty( $bosa_preschool_blogpartnerthreeID ) ){	
	$bosa_preschool_blog_partner_three = wp_get_attachment_image_src( $bosa_preschool_blogpartnerthreeID,'bosa-preschool-420-300');
	if ( is_array(  $bosa_preschool_blog_partner_three ) ){
		$bosa_preschool_has_partner = true;
      	$bosa_preschool_blog_partner_three = $bosa_preschool_blog_partner_three[0];
      	$bosa_preschool_partner_array['image_three'] = array(
			'ID' => $bosa_preschool_blog_partner_three,
		);	
  	}
}
if( !empty( $bosa_preschool_blogpartnerfourID ) ){	
	$bosa_preschool_blog_partner_four = wp_get_attachment_image_src( $bosa_preschool_blogpartnerfourID,'bosa-preschool-420-300');
	if ( is_array(  $bosa_preschool_blog_partner_four ) ){
		$bosa_preschool_has_partner = true;
      	$bosa_preschool_blog_partner_four = $bosa_preschool_blog_partner_four[0];
      	$bosa_preschool_partner_array['image_four'] = array(
			'ID' => $bosa_preschool_blog_partner_four,
		);	
  	}
}
if( !empty( $bosa_preschool_blogpartnerfiveID ) ){	
	$bosa_preschool_blog_partner_five = wp_get_attachment_image_src( $bosa_preschool_blogpartnerfiveID,'bosa-preschool-420-300');
	if ( is_array(  $bosa_preschool_blog_partner_five ) ){
		$bosa_preschool_has_partner = true;
      	$bosa_preschool_blog_partner_five = $bosa_preschool_blog_partner_five[0];
      	$bosa_preschool_partner_array['image_five'] = array(
			'ID' => $bosa_preschool_blog_partner_five,
		);	
  	}
}
if( !empty( $bosa_preschool_blogpartnersixID ) ){	
	$bosa_preschool_blog_partner_six = wp_get_attachment_image_src( $bosa_preschool_blogpartnersixID,'bosa-preschool-420-300');
	if ( is_array(  $bosa_preschool_blog_partner_six ) ){
		$bosa_preschool_has_partner = true;
      	$bosa_preschool_blog_partner_six = $bosa_preschool_blog_partner_six[0];
      	$bosa_preschool_partner_array['image_six'] = array(
			'ID' => $bosa_preschool_blog_partner_six,
		);	
  	}
}

if( !get_theme_mod( 'bosa_preschool_disable_partners_section', true ) && $bosa_preschool_has_partner ){ ?>
	<section class="section-partner-area">
		<div class="content-wrap">
			<div class="row">
				<?php foreach( $bosa_preschool_partner_array as $bosa_preschool_each_partner ){ ?>
					<div class="col-sm-4 col-md-3 col-lg-2 col-6">
						<article class="partner-content-wrap">
							<figure class= "featured-image">
								<img src="<?php echo esc_url( $bosa_preschool_each_partner['ID'] ); ?>">
							</figure>
						</article>
					</div>
				<?php } ?>
			</div>	
		</div>
	</section>
<?php } ?>