<!--Project Section-->
<section class="project-section" style="background-image:url('<?php echo esc_url($bg_img); ?>')">
    <div class="auto-container">
    
        <!--Porfolio Tabs-->
        <div class="project-tab">
            <!--Sec Title-->
            <div class="sec-title light clearfix">
                <div class="pull-left">
                    <h2><?php echo wp_kses_post($title); ?></h2>
                </div>
                <div class="tab-btns-box pull-right">
                    <!--Tabs Header-->
                    <div class="tabs-header">
                        <ul class="product-tab-btns clearfix">
                            <?php foreach( $atts['project_tab'] as $key => $item ):?>
                            <li class="p-tab-btn <?php if($key == 1) echo 'active-btn';?>" data-tab="#p-tab-<?php echo esc_attr($key);?>"><?php echo wp_kses_post($item->list_title);?></li>
                            <?php endforeach; ?>
                        </ul>
                    </div>
                </div>
            </div>
            <!--Tabs Content-->  
            <div class="p-tabs-content">
                <?php foreach( $atts['project_tab'] as $keys => $item ):
					$num = $item->num;
					$cat = $item->cat;
					$sort = $item->sort;
					$order = $item->order;
				?>
                <!--Portfolio Tab / Active Tab-->
                <div class="p-tab <?php if($keys == 1) echo 'active-tab';?>" id="p-tab-<?php echo esc_attr($keys);?>">
                    <div class="project-carousel owl-theme owl-carousel">
                        <?php  
						   $count = 1;
						   $query_args = array('post_type' => 'bunch_projects' , 'showposts' => $num , 'order_by' => $sort , 'order' => $order);
						   if( $cat ) $query_args['projects_category'] = $cat;
						   $query = new WP_Query($query_args); 
							
							if($query->have_posts()):
							 
							while($query->have_posts()): $query->the_post();
							global $post ;
							$project_meta = _WSH()->get_meta();
						?>
                        <!--Gallery Item-->
                        <div class="gallery-item">
                            <div class="inner-box">
                                <figure class="image-box">
                                    <?php the_post_thumbnail('manufacto_270x200'); ?>
                                    <!--Overlay Box-->
                                    <div class="overlay-box">
                                        <div class="overlay-inner">
                                            <a href="<?php echo esc_url(get_permalink(get_the_id()));?>" class="image-link"><span class="icon fa fa-link"></span></a>
                                            <div class="content">
                                                <h3><a href="<?php echo esc_url(get_permalink(get_the_id()));?>"><?php the_title(); ?></a></h3>
                                                <?php $term_list = wp_get_post_terms(get_the_id(), 'projects_category', array("fields" => "names")); ?>
												<div class="category"><?php echo implode( ', ', (array)$term_list );?></div>
                                            </div>
                                        </div>
                                    </div>
                                </figure>
                            </div>
                        </div>
                        <?php endwhile; endif;?> 
                    </div>
                </div>
                <?php endforeach;?>
            </div>
                
        </div>
        
    </div>
</section>
<!--End Project Section-->