<?php
/**
 * Custom Client Funtions
 *
 * @package Matrimony
 */
$matrimonial_client_option = get_theme_mod('matrimonial_client_option', 0 );
$matrimony_client_logo_image = get_theme_mod('matrimony_client_logo_image');
$matrimony_client_logo_image = explode(',', $matrimony_client_logo_image);
$matrimony_client_page  = get_theme_mod('matrimony_client_page',0); 
if( 0 == $matrimonial_client_option ){
	return;
}
?>
<section class="partner-section default-padding">
    <div class="container">
		<?php   if( !empty( $matrimony_client_page ) ): 
			$args = array (                                 
			'page_id'           => absint( $matrimony_client_page ),
			'post_status'       => 'publish',
			'post_type'         => 'page',
			);
			$loop_client = new WP_Query($args);
			if ( $loop_client->have_posts() ) : ?>
		        <div class="section-intro animated wow fadeInDown" data-wow-duration="1s">
		        	<?php while ($loop_client->have_posts()) : $loop_client->the_post();?>
			            <header class="entry-header heading">
			                <h4 class="entry-title"><?php the_title(); ?></h4>
			            </header>
			            <div class="header-img-wrap">
			            	  <?php the_post_thumbnail(); ?>
			            </div>
                        <?php 
                        $client_des_option = get_theme_mod('matrimonial_client_des_option', 0 );
                        if( $client_des_option == '1' ):
                    	?>
							<div class="section-description animated wow fadeInUp" data-wow-duration="1s">
								<p> <?php echo esc_html(wp_trim_words(get_the_content(),30,'&hellip;')); ?></p>
							</div>
	                    <?php endif; ?>
	        		<?php endwhile; ?>       
		        </div>
			<?php endif;
			wp_reset_postdata();
		endif; ?>
        <div class="partner-wrap animated wow fadeInUp" data-wow-duration="1s">
        	<?php
        	foreach ($matrimony_client_logo_image as $matrimonial_client_logo_image_single) {
        		$image = wp_get_attachment_image_src( $matrimonial_client_logo_image_single, 'full');
        		?>
                <div class="partner-item">
                  <img src="<?php echo esc_url( $image[0] ); ?>">
                </div>
            <?php }  ?> 
        </div>
    </div>
</section><!-- partner-section end -->
