<?php
/**
 * Feature Section
*/
        if(get_theme_mod('the_angle_feature_section','no') == 'yes'):
              $feature_cat = esc_attr(get_theme_mod('the_angle_feature_section_category',''));
              $feature_readmore = esc_html(get_theme_mod('the_angle_feature_readmore',esc_html__('Read More','the-angle')));
              $feature_title = get_theme_mod('the_angle_feature_us_title',esc_html__('About Us','the-angle'));
              $the_angle_feature_section_layout = get_theme_mod('the_angle_feature_section_layout','layout-1');
             if($feature_cat):
              $i=0;
                $args_query = new WP_Query(array('post_type' => 'post', 'posts_per_page' =>-1, 'category_name' => $feature_cat));
                if ($args_query->have_posts()) :?>
                    <section id="feature-section" class="the-angle-feature-section <?php echo esc_attr($the_angle_feature_section_layout); ?>">
                           <div class="tc-container">
                              <div class="title-wrp">
                              <h2 class="section-title">
                                <?php echo esc_html($feature_title);?>
                               </h2>
                               </div>
                                <div class="feature-wrap">
                                <?php
                                while ($args_query->have_posts()):
                                    $args_query->the_post();
                                    $feature_slider_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'angle-feature-thumb');
                                    $i++;
                                    ?>

                                        <div class="feature-the-angle">
                                            <div class="featured-block<?php if($i%5==0){echo " nomargin";} echo ' featured-post-'.$i;?> wow fadeInLeft"  data-wow-delay="<?php echo $i*0.3;?>s">
                                               <div class="cat-caption">
                                                      <?php if(has_post_thumbnail()): ?>
                                                      <div class="feature-image">
                                                       <img src="<?php echo esc_url($feature_slider_image[0]); ?>" title="<?php the_title_attribute(); ?>" alt="<?php the_title_attribute(); ?>" />
                                                      </div>
                                                      <?php endif; ?>
                                                     <div class="the-angle-feature-caption">
                                                          <h2 class="feature-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
                                                            <div class="feature-section-des">
                                                             <?php echo esc_attr(wp_trim_words(get_the_content(),'20','...')); ?>
                                                             </div>
                                                          <?php
                                                          if(!empty($feature_readmore)){
                                                              ?>
                                                         <a href="<?php the_permalink();?>" class="btn more"><?php echo $feature_readmore;?></a>
                                                         <?php
                                                           }
                                                           ?>
                                                    </div>
                                                 </div>
                                              </div>
                                          </div>

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