<?php
$bosa_real_estate_group_blogpartneroneID = get_theme_mod( 'bosa_real_estate_group_blog_partner_one','' );
$bosa_real_estate_group_blogpartnertwoID = get_theme_mod( 'bosa_real_estate_group_blog_partner_two','' );       
$bosa_real_estate_group_blogpartnerthreeID = get_theme_mod( 'bosa_real_estate_group_blog_partner_three','' );
$bosa_real_estate_group_blogpartnerfourID = get_theme_mod( 'bosa_real_estate_group_blog_partner_four','' );
$bosa_real_estate_group_blogpartnerfiveID = get_theme_mod( 'bosa_real_estate_group_blog_partner_five','' );
$bosa_real_estate_group_blogpartnersixID = get_theme_mod( 'bosa_real_estate_group_blog_partner_six','' );

$bosa_real_estate_group_partner_array = array();
$bosa_real_estate_group_has_partner = false;
if( !empty( $bosa_real_estate_group_blogpartneroneID ) ){
	$bosa_real_estate_group_blog_partner_one  = wp_get_attachment_image_src( $bosa_real_estate_group_blogpartneroneID,'bosa-real-estate-group-420-300');
 	if ( is_array(  $bosa_real_estate_group_blog_partner_one ) ){
 		$bosa_real_estate_group_has_partner = true;
   	 	$bosa_real_estate_group_blog_partner_one = $bosa_real_estate_group_blog_partner_one[0];
   	 	$bosa_real_estate_group_partner_array['image_one'] = array(
			'ID' => $bosa_real_estate_group_blog_partner_one,
		);	
  	}
}
if( !empty( $bosa_real_estate_group_blogpartnertwoID ) ){
	$bosa_real_estate_group_blog_partner_two = wp_get_attachment_image_src( $bosa_real_estate_group_blogpartnertwoID,'bosa-real-estate-group-420-300');
	if ( is_array(  $bosa_real_estate_group_blog_partner_two ) ){
		$bosa_real_estate_group_has_partner = true;	
        $bosa_real_estate_group_blog_partner_two = $bosa_real_estate_group_blog_partner_two[0];
        $bosa_real_estate_group_partner_array['image_two'] = array(
			'ID' => $bosa_real_estate_group_blog_partner_two,
		);	
  	}
}
if( !empty( $bosa_real_estate_group_blogpartnerthreeID ) ){	
	$bosa_real_estate_group_blog_partner_three = wp_get_attachment_image_src( $bosa_real_estate_group_blogpartnerthreeID,'bosa-real-estate-group-420-300');
	if ( is_array(  $bosa_real_estate_group_blog_partner_three ) ){
		$bosa_real_estate_group_has_partner = true;
      	$bosa_real_estate_group_blog_partner_three = $bosa_real_estate_group_blog_partner_three[0];
      	$bosa_real_estate_group_partner_array['image_three'] = array(
			'ID' => $bosa_real_estate_group_blog_partner_three,
		);	
  	}
}
if( !empty( $bosa_real_estate_group_blogpartnerfourID ) ){	
	$bosa_real_estate_group_blog_partner_four = wp_get_attachment_image_src( $bosa_real_estate_group_blogpartnerfourID,'bosa-real-estate-group-420-300');
	if ( is_array(  $bosa_real_estate_group_blog_partner_four ) ){
		$bosa_real_estate_group_has_partner = true;
      	$bosa_real_estate_group_blog_partner_four = $bosa_real_estate_group_blog_partner_four[0];
      	$bosa_real_estate_group_partner_array['image_four'] = array(
			'ID' => $bosa_real_estate_group_blog_partner_four,
		);	
  	}
}
if( !empty( $bosa_real_estate_group_blogpartnerfiveID ) ){	
	$bosa_real_estate_group_blog_partner_five = wp_get_attachment_image_src( $bosa_real_estate_group_blogpartnerfiveID,'bosa-real-estate-group-420-300');
	if ( is_array(  $bosa_real_estate_group_blog_partner_five ) ){
		$bosa_real_estate_group_has_partner = true;
      	$bosa_real_estate_group_blog_partner_five = $bosa_real_estate_group_blog_partner_five[0];
      	$bosa_real_estate_group_partner_array['image_five'] = array(
			'ID' => $bosa_real_estate_group_blog_partner_five,
		);	
  	}
}
if( !empty( $bosa_real_estate_group_blogpartnersixID ) ){	
	$bosa_real_estate_group_blog_partner_six = wp_get_attachment_image_src( $bosa_real_estate_group_blogpartnersixID,'bosa-real-estate-group-420-300');
	if ( is_array(  $bosa_real_estate_group_blog_partner_six ) ){
		$bosa_real_estate_group_has_partner = true;
      	$bosa_real_estate_group_blog_partner_six = $bosa_real_estate_group_blog_partner_six[0];
      	$bosa_real_estate_group_partner_array['image_six'] = array(
			'ID' => $bosa_real_estate_group_blog_partner_six,
		);	
  	}
}

if( !get_theme_mod( 'bosa_real_estate_group_disable_partners_section', true ) && $bosa_real_estate_group_has_partner ){ ?>
	<section class="section-partner-area">
		<div class="content-wrap">
			<div class="row">
				<?php foreach( $bosa_real_estate_group_partner_array as $bosa_real_estate_group_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_real_estate_group_each_partner['ID'] ); ?>">
							</figure>
						</article>
					</div>
				<?php } ?>
			</div>	
		</div>
	</section>
<?php } ?>