<?php
$query_args = array('post_type' => 'bunch_services' , 'showposts' => $num , 'order_by' => $sort , 'order' => $order);
if( $cat ) $query_args['services_category'] = $cat;
$query = new WP_Query($query_args) ; 

?>

<?php if($query->have_posts()):  ?>


<!--Services Section-->
<section class="services-section">
	<div class="auto-container">
		<div class="row clearfix">
		
			<?php 
				while($query->have_posts()): $query->the_post();
				 $services_meta = _WSH()->get_meta();
			     $flat_icon = buildark_set( $services_meta, 'fontawesome' );
				 $flat_icon = ( $flat_icon ) ? $flat_icon : 'flaticon-ruler';
				 $read_more_link = buildark_set( $services_meta, 'ext_url' );
                 global $post;
			?>
		
				<!--Services Block-->
                <div class="services-block col-lg-4 col-md-6 col-sm-6 col-xs-12">
                	<div class="inner-box">
                    	<div class="image">
                        	<?php 
								the_post_thumbnail( 'buildark_370x205', array( 'class' => 'img-responsive' ) );  ?>
                        </div>
                        <div class="lower-content">
                        	<div class="upper-box">
                            	<div class="icon-box">
                                	<span class="icon <?php echo esc_attr( $flat_icon );  ?>"></span>
                                </div>
                            	<h3><a href="<?php echo esc_url( $read_more_link ); ?>"><?php the_title(); ?></a></h3>
                            </div>
                            <div class="text"><?php echo wp_trim_words( get_the_content(), $text_limit );  ?></div>
                        </div>
                    </div>
                </div>
                
			<?php endwhile; ?>

		</div>
	</div>
</section>
<!--End Services Section-->


<?php endif; ?>

<?php wp_reset_postdata();