<?php
$bg_img = ( $bg_img ) ? $bg_img : get_template_directory_uri() . '/assets/images/background/5.jpg';
$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) ; 

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

<!--Featured Section Two-->
<section class="featured-section-two" style="background-image:url(<?php echo esc_url( $bg_img ); ?>);">
	<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;
			?>
			
				<!--Featured Block Two-->
				<div class="featured-block-two col-lg-3 col-md-4 col-sm-6 col-xs-12">
					<div class="inner-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 class="text"><?php echo wp_trim_words( get_the_content(), $text_limit );  ?></div>
                        <a href="<?php echo esc_url( $read_more_link ); ?>" class="uni-btn"><?php esc_html_e('Read More', 'buildark');?><i class="fa fa-long-arrow-right"></i></a>
					</div>
				</div>
				
				
			<?php endwhile; ?>

		</div>
	</div>
</section>
<!--End Featured Section Two-->


<?php endif;
wp_reset_postdata();