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

?>
<?php if( $query->have_posts() ):
while( $query->have_posts() ): $query->the_post();
	global  $post;
	$meta1 = _WSH()->get_meta();
	$active_list = ($count == 1) ? 'active-btn' : '';
	$active_tab = ($count == 1) ? 'active-tab' : '';
	$features = explode("\n", tycheproperty_set($meta1, 'ser_features'));
	foreach($features as $key => $value){
		$ser_features .= '<li>'.$value.'</li>';
	}
	$data_list[get_the_id()] = '<a href="#tab-one'.get_the_id().'" class="tab-btn '.$active_list.'">'.get_the_title(get_the_id()).'</a>';
	$data_post[get_the_id()] = '<!--Tab / Active Tab-->
                            <div class="tab '.$active_tab.'" id="tab-one'.get_the_id().'">
                                <div class="text">
                                    <p>'.get_the_content().'</p>
                                </div>
                                
                                <div class="row clearfix">
                                    <div class="column col-xs-12">
                                        <!--Styled List-->
                                        <ul class="styled-list-one">
                                            '.$ser_features.'
                                        </ul>
                                    </div>
                                
								</div>
                            </div>';
$ser_features= '';
$count++; 
endwhile;
?>
<?php 
endif;
wp_reset_postdata();
ob_start();?>	 

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

<!--Property Details Section-->
<section class="property-details">
    
    <!--Image Column-->
    <div class="image-column" style="background-image:url('<?php echo esc_url(wp_get_attachment_url($image));?>');">
        <div class="hidden-image"><img src="<?php echo esc_url(wp_get_attachment_url($image));?>" alt=""></div>
        <div class="dimensions-box wow fadeIn" data-wow-duration="1500ms" data-wow-delay="0ms"><div class="size"><?php echo balanceTags($room_size);?></div> <div class="place-title"><?php echo balanceTags($room_description1);?><span class="light-font"><?php echo balanceTags($room_description2);?></span></div></div>
    </div>
    
    <div class="auto-container">
        <div class="row clearfix">
            
            <!--Right Column-->
            <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12 right-column">
                <div class="inner-box">
                    <h2><strong><?php echo balanceTags($title1);?></strong> <?php echo balanceTags($title2);?></h2>
                    <!--Tabs Box-->
                    <div class="tabs-box">
                        
                        <!--Tab Buttons-->
                        <div class="tab-buttons clearfix">
                            <?php echo implode("\n",(array)$data_list);?> 
                        </div>
                        
                        <!--Tabs Content-->
                        <div class="tab-content">
                            <?php echo implode("\n",(array)$data_post);?>
                        </div>
                    </div>
                </div>
            </div><!--End Right Column-->
            
        </div>
    </div>
</section>

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