<?php
   /* 
   * Theme: PREMIUMPRESS CORE FRAMEWORK FILE
   * Url: www.premiumpress.com
   * Author: Mark Fail
   *
   * THIS FILE WILL BE UPDATED WITH EVERY UPDATE
   * IF YOU WANT TO MODIFY THIS FILE, CREATE A CHILD THEME
   *
   * http://codex.wordpress.org/Child_Themes
   */
   if (!defined('THEME_VERSION')) {	header('HTTP/1.0 403 Forbidden'); exit; }
   
   global $post;
   ?>
<div class="widget" id="widget-nearby" data-title="<?php echo __("Nearby Listings","premiumpress") ?>">
   <?php 
   
   // WIDGET OPTION
   // SHOW TITLE
   if(!isset($settings['showtitle']) || ( isset($settings['showtitle']) && $settings['showtitle'] != 0) ){ ?><div class="widget-title"><i class="fa fa-sign float-right mt-1"></i><h6><?php echo __("Nearby Listings","premiumpress") ?></h6></div><?php } ?>  
<div class="owl-carousel small-list p-0" id="nearby" data-autoPlay="1" data-items="4" data-stagePadding="10">
<?php echo do_shortcode('[LISTINGS dataonly=1 show=20 small=1 carousel=1 custom="nearby"]'); ?> 
</div>
</div>
<script>
jQuery(document).ready(function() {
jQuery("#nearby").owlCarousel({ items : 1, autoPlay : true, loop:true, stagePadding:10, margin:10, });

	// SHOW HIDE BOX IS NO CONTENT	
	 setTimeout(function(){  
		if(jQuery('#widget-nearby').height() < 200){ 
			jQuery('#widget-nearby').hide();
		}
	}, 1000);

});	
</script> 