<!--Project Section-->
<section class="project-section">
	<div class="auto-container">

		<!--Porfolio Tabs-->
		<div class="project-tab">
			<!--Sec Title-->
			<div class="sec-title light no-border 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( $projects_tabs 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->tab_title );?></li>
								
							<?php endforeach; ?>
						
						</ul>
					</div>
				</div>
			</div>
			<!--Tabs Content-->  
			<div class="p-tabs-content">
				<!--Portfolio Tab / Active Tab-->
						
					<?php foreach( $projects_tabs as $keys => $item ) :
						
						$num = $item->num;
						$cat = $item->cat;
						$sort = $item->sort;
						$order = $item->order; 
						$text_limit = $item->text_limit;
						
						$count = 0;
						$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 ) ;
					?>

					<!--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">
							<!--Shop Item-->

							<?php while ( $query->have_posts() ) : $query->the_post();
								global $post; 
								$projects_meta = _WSH()->get_meta();
								$post_thumbnail_id = get_post_thumbnail_id( $post->ID );
								$post_thumbnail_url = wp_get_attachment_url( $post_thumbnail_id );
								$term_list = wp_get_post_terms( get_the_id(), 'projects_category', array( "fields" => "names" ) );
							?>

							<div class="gallery-item">
								<div class="inner-box">
									<figure class="image-box">
										<?php the_post_thumbnail( 'buildark_270x200', array( 'class' => 'img-responsive' ) ); ?>
										<div class="overlay-box">
											<div class="overlay-inner">
												<div class="content">
													<a href="<?php echo esc_url( $ext_link ); ?>" class="image-link"><span class="icon fa fa-link"></span></a>
													<a href="<?php echo esc_url( $post_thumbnail_url ); ?>" class="lightbox-image image-link"  data-fancybox-group="example-gallery" title="<?php esc_attr_e('image', 'buildark');?>"><span class="icon fa fa-search-plus"></span></a>
												</div>
											</div>
										</div>
									</figure>
                                    
                                    <div class="content-box">
										<h3><a href="<?php echo esc_url( $ext_link ); ?>"><?php the_title(); ?></a></h3>
										<div class="category"><?php echo implode( ', ', (array)$term_list );?></div>
										<p class="text"><?php echo wp_kses_post(buildark_trim( get_the_content(), $text_limit ));?></p>
									</div>
								</div>
							</div>
							<?php endwhile;?>
						</div>
					</div>
					<?php endforeach; ?>
			</div>
				
		</div>
	</div>
</section>
<!--End Product Tab Section-->