<?php
/**
 *Client Section
*/
if(get_theme_mod('the_angle_client_section','no') == 'yes'):
   $client_news_cat = esc_attr(get_theme_mod('the_angle_client_section_category',''));
   $the_angle_client_layout = get_theme_mod('the_angle_client_section_layout','layout-1');
   $client_homepage_title = get_theme_mod('the_angle_client_title');
  if($client_news_cat):
    $i=0;
    $args_query = new WP_Query(array('post_type' => 'post', 'posts_per_page' =>-1, 'category_name' => $client_news_cat));
    if ($args_query->have_posts()) :?>
          <section id="client-section" class="the-angle-client-section <?php echo esc_attr($the_angle_client_layout); ?>">
              <div class="carousel section-wrapper">
                    <div class="tc-container">
                        <div class="row">
                              <div class="carousel2-content tcenter clearfix">
                                    <div class="title-wrp">
                                          <h2 class="section-title"><?php echo wp_kses_post($client_homepage_title); ?></h2>
                                      </div>
                                      <div class="client-wrp">
                                         <?php if($the_angle_client_layout != 'layout-2' ){ ?>
                                       <div class="affiliation-slider">
                                            <?php } ?>
                                            <?php
                                            while ($args_query->have_posts()):
                                                $args_query->the_post();
                                                $client_slider_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'the-angle-client-thumb',true);
                                                $i++;
                                                ?>
                                                <div class="client-block<?php if($i%5==0){echo " nomargin";} echo ' client-post-'.$i;?> wow fadeInLeft" data-wow-delay="<?php echo $i*0.3;?>">
                                                    <div class="client_the_consult">
                                                       <div class="cat-caption">
                                                              <?php if(has_post_thumbnail()): ?>
                                                              <div class="client-news-image">
                                                               <img src="<?php echo esc_url($client_slider_image[0]); ?>" title="<?php the_title_attribute(); ?>" alt="<?php the_title_attribute(); ?>" />
                                                              </div>
                                                              <?php endif; ?>
                                                         </div>
                                                      </div>
                                                  </div>

                                                <?php
                                            endwhile;
                                            wp_reset_postdata();
                                            ?>
                                        </div>
                                    </div>
                              </div>
                        </div>
                    </div>
                </div>
            </section>
        <?php
      endif;
  endif;
endif;
  ?>
