<?php 
wp_enqueue_script('jquery-mixitup');
tycheproperty_bunch_global_variable();
$count = 0;
$args = array('post_type' => 'bunch_floorplans', 'showposts'=>$num, 'orderby'=>$sort, 'order'=>$order);
 if( $cat ) $args['floorplans_category'] = $cat;
$query = new WP_Query($args);
$data_list = array();
$data_post = array();
$gal_features= '';

?>
<?php if( $query->have_posts() ):
while( $query->have_posts() ): $query->the_post();
	global  $post;
	$meta1 = _WSH()->get_meta();
	$active_list = ($count == 1) ? 'active' : '';
	$active_tab = ($count == 1) ? 'collapsed' : '';
	$features = explode("\n", tycheproperty_set($meta1, 'gal_features'));
	foreach($features as $key => $value){
		$gal_features .= '<li>'.$value.'</li>';
	}
	$data_list[get_the_id()] = '<li><a href="#floor-A'.get_the_id().'" class="floor-btn '.$active_list.'">'.get_the_title(get_the_id()).'</a></li>';
								
	
	$data_post[get_the_id()] = '<div class="floor-details '.$active_tab.'" id="floor-A'.get_the_id().'">
									<div class="row clearfix">
										<!--Content Column-->
										<div class="content-column col-md-7 col-sm-12 col-xs-12">
											<h3>'.tycheproperty_set($meta1, 'sub_title').'</h3>
											<div class="desc-text">'.get_the_content($post->ID).'</div>
											<div class="specs row clearfix">
												<div class="column">
													<!--Styled List-->
													<ul class="styled-list-one">
														'.$gal_features.'
													</ul>
												</div>
											</div>
											<div class="property-info">
												<ul class="inline-list">
													<li><span class="icon flaticon-business-1"></span>'.tycheproperty_set($meta1, 'area').'<sup>'.esc_html_e('2', 'tycheproperty').'</sup></li>
													<li><span class="icon flaticon-double-king-size-bed"></span>'.tycheproperty_set($meta1, 'beds').'</li>
													<li><span class="icon flaticon-old"></span>'.tycheproperty_set($meta1, 'kitchen').'</li>
													<li><span class="icon flaticon-buildings-1"></span>'.tycheproperty_set($meta1, 'bulding').'</li>
												</ul>
											</div>
										</div>
										<!--Image Column-->
										<div class="image-column col-md-5 col-sm-12 col-xs-12">
											<figure class="image">'.get_the_post_thumbnail($post->ID, array('tycheproperty_400x267')).'</figure>
										</div>
										
									</div>
								</div>';
$count++; 
endwhile;
?>
<?php 
endif;
wp_reset_postdata();
ob_start();?>	 

<?php $terms = get_terms(array('floorplans_category')); ?>

<!--Tabbed Floor Plans Section-->
<section class="tabbed-floor-plans" style="background-image:url(images/background/image-5.png);">
    <div class="auto-container">
        
        <!--Section Title-->
        <div class="sec-title text-center">
            <h2><strong><?php echo balanceTags($title);?></strong> <?php echo balanceTags($title1);?></h2>
            <div class="subtitle-text"><?php echo balanceTags($text);?></div>
        </div>
        
        <!--Floor Links-->
        <div class="floor-links">
            <ul class="links">
                <?php echo implode("\n",(array)$data_list);?>
            </ul>
        </div>
        
        <!--Floors Content-->
        <div class="floors-content">
        	<?php echo implode("\n",(array)$data_post);?>    
        </div>
        
    </div>
</section>

<?php $output = ob_get_contents();
ob_end_clean(); 
return $output;?>