Beispiel #1
0
    if ($layout == '1c') {
        $posts_per_page = 4;
    }
}
$args = array('posts_per_page' => $posts_per_page, 'post_type' => 'listing', 'post_status' => 'publish', 'post__not_in' => (array) $current_post, 'tax_query' => $tax_query, 'meta_query' => array('relation' => 'OR', array('key' => bon_get_prefix() . 'listing_price', 'compare' => 'BETWEEN', 'value' => array($price_min, $price_max), 'type' => 'NUMERIC')));
$related_query = get_posts($args);
if ($related_query) {
    $compare_page = bon_get_option('compare_page');
    ?>
<h3 class="related-property-header"><?php 
    _e('Related Properties', 'bon');
    ?>
</h3>
<hr />
<ul class="listings related <?php 
    shandora_block_grid_column_class();
    ?>
" data-compareurl="<?php 
    echo get_permalink($compare_page);
    ?>
">
			
<?php 
    foreach ($related_query as $post) {
        $status = shandora_get_meta($post->ID, 'listing_status');
        $bed = shandora_get_meta($post->ID, 'listing_bed');
        $bath = shandora_get_meta($post->ID, 'listing_bath');
        $lotsize = shandora_get_meta($post->ID, 'listing_buildingsize');
        $sizemeasurement = bon_get_option('measurement');
        ?>
<li>
Beispiel #2
0
    function shandora_listing_open_ul()
    {
        $compare_page = bon_get_option('compare_page');
        if ((is_page_template('page-templates/page-template-property-status.php') || is_page_template('page-templates/page-template-car-status.php') || get_post_type() == 'listing' || get_post_type() == 'boat-listing' || get_post_type() == 'car-listing' || is_page_template('page-templates/page-template-all-listings.php') || is_page_template('page-templates/page-template-all-car-listings.php') || is_page_template('page-templates/page-template-search-listings.php') || is_page_template('page-templates/page-template-search-boat.php') || is_page_template('page-templates/page-template-all-boats.php') || is_page_template('page-templates/page-template-search-car-listings.php')) && !is_singular('listing') && !is_singular('car-listing') && !is_singular('boat-listing') && !is_search()) {
            $show_map = 'no';
            $show_listing_count = bon_get_option('show_listing_count', 'no');
            if ((is_page_template('page-templates/page-template-property-status.php') || get_post_type() == 'listing' || is_page_template('page-templates/page-template-all-listings.php') || is_page_template('page-templates/page-template-search-listings.php')) && !is_singular('listing') && !is_singular('car-listing') && !is_singular('boat-listing')) {
                $show_map = bon_get_option('show_listings_map');
            }
            ?>
		<div class="listing-header">
		<div class="row">
		
		<?php 
            if ($show_listing_count) {
                echo '<div class="column large-6"><h3 id="listed-property"></h3></div>';
            }
            ?>
		
		<?php 
            $search_order = isset($_GET['search_order']) ? $_GET['search_order'] : bon_get_option('listing_order', 'DESC');
            $search_orderby = isset($_GET['search_orderby']) ? $_GET['search_orderby'] : bon_get_option('listing_orderby', 'date');
            ?>

			<div class="column large-6 right">

				<div class="row">
					<div class="column large-3">
						<?php 
            $view = isset($_GET['view']) ? $_GET['view'] : 'grid';
            $newurl = '';
            foreach ($_GET as $variable => $value) {
                if ($variable != 'view') {
                    $newurl .= $variable . '=' . $value . '&';
                }
            }
            $newurl = rtrim($newurl, '&');
            if (empty($newurl)) {
                $uri = shandora_get_site_url() . strtok($_SERVER["REQUEST_URI"], '?');
                $newurl = $uri . '?view=';
            } else {
                $uri = shandora_get_site_url() . strtok($_SERVER["REQUEST_URI"], '?');
                $newurl = $uri . '?' . $newurl . '&view=';
            }
            ?>
						<a class="view-button button blue flat view-grid <?php 
            echo $view == 'grid' ? 'selected' : '';
            ?>
 " href="<?php 
            echo $newurl . 'grid';
            ?>
"><i class="bonicons bi-th"></i></a>
						<a class="view-button button blue flat view-list <?php 
            echo $view == 'list' ? 'selected' : '';
            ?>
" href="<?php 
            echo $newurl . 'list';
            ?>
"><i class="bonicons bi-list"></i></a>
					</div>
					<div class="column large-9">
						<form class="custom" action="<?php 
            echo $_SERVER['REQUEST_URI'];
            ?>
" method="get" id="orderform" name="orderform">
				            
				            <div class="row">
				                <div class="column large-6 search-order">
				                    <select class="no-mbot" name="search_order" onChange="document.forms['orderform'].submit()">
				                        <option value="ASC" <?php 
            selected($search_order, 'ASC');
            ?>
 ><?php 
            _e('Ascending', 'bon');
            ?>
</option>
				                        <option value="DESC" <?php 
            selected($search_order, 'DESC');
            ?>
 ><?php 
            _e('Descending', 'bon');
            ?>
</option>
				                    </select>
				                </div>
				                <div class="column large-6 search-order">
				                    <select class="no-mbot" name="search_orderby" onChange="document.forms['orderform'].submit()">
				                        <option value="price" <?php 
            selected($search_orderby, 'price');
            ?>
 ><?php 
            _e('Price', 'bon');
            ?>
</option>
				                        <option value="date" <?php 
            selected($search_orderby, 'date');
            ?>
 ><?php 
            _e('Date', 'bon');
            ?>
</option>
				                        <option value="title" <?php 
            selected($search_orderby, 'title');
            ?>
 ><?php 
            _e('Title', 'bon');
            ?>
</option>
				                        <option value="size" <?php 
            selected($search_orderby, 'size');
            ?>
 >
				                        	<?php 
            if (get_post_type() == 'listing' || is_page_template('page-templates/page-template-search-listings.php') || is_page_template('page-templates/page-template-all-listings.php')) {
                echo __('Size', 'bon');
            } else {
                if (get_post_type() == 'car-listing' || is_page_template('page-templates/page-template-search-car-listings.php') || is_page_template('page-templates/page-template-all-car-listings.php')) {
                    echo __('Mileage', 'bon');
                } else {
                    if (get_post_type() == 'boat-listing' || is_page_template('page-templates/page-template-search-boat.php') || is_page_template('page-templates/page-template-all-boats.php')) {
                        echo __('Length', 'bon');
                    }
                }
            }
            ?>
				                        </option>
				                    </select>
				                </div>
					                <?php 
            foreach ($_GET as $name => $value) {
                if ($name != 'search_order' && $name != 'search_orderby') {
                    $name = htmlspecialchars($name);
                    $value = htmlspecialchars($value);
                    echo '<input type="hidden" name="' . $name . '" value="' . $value . '">';
                }
            }
            ?>
				            </div>
				        </form>
				    </div>
				</div>
			</div>
    	</div>
    	</div>
		<?php 
            if ($show_map == 'show') {
                $show_zoom = bon_get_option('show_listings_map_zoom', 'false');
                if ($show_zoom == 'show') {
                    $show_zoom = 'true';
                }
                $show_type = bon_get_option('show_listings_map_type', 'false');
                if ($show_type == 'show') {
                    $show_type = 'true';
                }
                echo '<div id="listings-map" data-show-zoom="' . $show_zoom . '" data-show-map-type="' . $show_type . '"></div>';
            }
            ?>
		<ul class="listings <?php 
            echo isset($_GET['view']) && $_GET['view'] == 'list' ? 'list-view' : shandora_block_grid_column_class(false);
            ?>
" data-compareurl="<?php 
            echo trailingslashit(get_permalink($compare_page));
            ?>
">
		<?php 
        }
    }