コード例 #1
0
    /**
     * Outputs the widget based on the arguments input through the widget controls.
     *
     * @since 1.0
     */
    function widget($sidebar, $instance)
    {
        extract($sidebar);
        /* Set the $args for wp_get_archives() to the $instance array. */
        $args = $instance;
        /* Overwrite the $echo argument and set it to false. */
        $args['echo'] = false;
        /* Output the theme's $before_widget wrapper. */
        echo $before_widget;
        /* If a title was input by the user, display it. */
        if (!empty($instance['title'])) {
            echo $before_title . apply_filters('widget_title', $instance['title'], $instance, $this->id_base) . $after_title;
        }
        ?>
		
		<div class="row">
			<div class="column large-12 featured-listing-carousel">
				<?php 
        $prefix = bon_get_prefix();
        $query = array('post_type' => 'listing', 'posts_per_page' => $args['limit'], 'meta_query' => array(array('key' => $prefix . 'listing_featured', 'value' => true, 'compare' => '=')));
        $featured_query = new WP_Query($query);
        if ($featured_query->have_posts()) {
            $i = 0;
            ?>

					<script>
						jQuery(document).ready(function($){
							$('#<?php 
            echo $this->id;
            ?>
-slider').flexslider({
								animation: "slide",
								controlNav: false,
								controlsContainer: "#<?php 
            echo $this->id;
            ?>
-nav"
							});
						});
					</script>
					<div id="<?php 
            echo $this->id;
            ?>
-nav" class="featured-listing-nav">
					</div>
					<div id="<?php 
            echo $this->id;
            ?>
-slider">

	        			<ul class="slides">

					<?php 
            while ($featured_query->have_posts()) {
                $featured_query->the_post();
                ?>
						<?php 
                if ($i == 0) {
                    ?>
							<li>
						<?php 
                }
                ?>
						
						<div class="featured-item">
							<?php 
                if (current_theme_supports('get-the-image')) {
                    get_the_image(array('size' => 'listing_medium', 'before' => '<div class="featured-image">', 'after' => '</div>'));
                }
                ?>
							<?php 
                $bed = shandora_get_meta(get_the_ID(), 'listing_bed');
                $bath = shandora_get_meta(get_the_ID(), 'listing_bath');
                ?>
							<span class="featured-item-meta hide-for-medium bed"><i class="sha-bed"></i><?php 
                echo $bed;
                ?>
</span>
							<span class="featured-item-meta hide-for-medium bath"><i class="sha-bath"></i><?php 
                echo $bath;
                ?>
</span>
							<div class="featured-item-title">
								<h2 class="title"><i class="bonicons bi-link"></i><a href="<?php 
                the_permalink();
                ?>
" title="<?php 
                the_title_attribute();
                ?>
" ><?php 
                the_title();
                ?>
</a></h2>
							</div>
						</div>
						
	                    <?php 
                $i++;
                if ($i == $args['per_slide']) {
                    $i = 0;
                    ?>
	                    	</li>
	                	<?php 
                }
                ?>
					<?php 
            }
            ?>
						<?php 
            if ($i > 0) {
                ?>
							</li>
						<?php 
            }
            ?>
						</ul>
						
					</div>

					<?php 
        } else {
            echo '<p>' . __('No property listing were found', 'bon') . '</p>';
        }
        wp_reset_query();
        ?>
			</div>
		</div>

	<?php 
        /* Close the theme's widget wrapper. */
        echo $after_widget;
    }
コード例 #2
0
<?php

$status = shandora_get_meta($post->ID, 'listing_status');
if (is_singular(get_post_type())) {
    ?>
<article id="post-<?php 
    the_ID();
    ?>
" <?php 
    post_class($status);
    ?>
 itemscope itemtype="http://schema.org/RealEstateAgent">
	<header class="entry-header clear">
		<?php 
    echo apply_atomic_shortcode('entry_title', the_title('<h1 class="entry-title" itemprop="name">', '</h1>', false));
    ?>
		
		<a class="print" href="javascript:window.print()"><i class="sha-printer"></i></a>
		<?php 
    echo apply_atomic_shortcode('entry_fav', '[bon-fav]');
    ?>
		<?php 
    echo apply_atomic_shortcode('listing_published', '[entry-edit-link] [entry-published before="<div class=\'show-for-large\'>" after="</div>" text="' . __('Published on', 'bon') . '"]');
    ?>
		<h4 class="price"><?php 
    shandora_get_listing_price();
    ?>
</h4>

	</header><!-- .entry-header -->
コード例 #3
0
<?php

$status = shandora_get_meta($post->ID, 'listing_status');
$badge = shandora_get_meta($post->ID, 'listing_badge');
$badgeclr = shandora_get_meta($post->ID, 'listing_badge_color');
$size = isset($_GET['view']) && $_GET['view'] == 'list' ? 'listing_list' : 'listing_small';
?>
<header class="entry-header">

	<?php 
$_overlay_btns = bon_get_option('overlay_buttons', array('link' => true, 'gallery' => true, 'compare' => true, 'icon' => true, 'thumbnail' => true));
$link_btn = $_overlay_btns['link'] == true ? true : false;
$gallery_btn = $_overlay_btns['gallery'] == true ? true : false;
$compare_btn = $_overlay_btns['compare'] == true ? true : false;
$thumb_btn = isset($_overlay_btns['thumbnail']) && $_overlay_btns['thumbnail'] == true ? true : false;
if (bon_get_option('show_overlay', 'yes') == 'yes' && ($link_btn || $gallery_btn || $compare_btn)) {
    ?>
		<div class="listing-hover">
			<span class="mask"></span>
			<?php 
    echo shandora_get_listing_hover_action(get_the_ID());
    ?>
		</div>
	<?php 
}
?>
	<?php 
if (get_post_type() == 'listing') {
    $terms = get_the_terms(get_the_ID(), "property-type");
    if ($terms && !is_wp_error($terms)) {
        foreach ($terms as $term) {
コード例 #4
0
ファイル: my-account.php プロジェクト: VadimSid/thinkgreek
            echo shandora_column_class('large-12');
            ?>
">

					<ul class="listings <?php 
            echo $ul_class;
            ?>
" data-compareurl="<?php 
            echo get_permalink($compare_page);
            ?>
">

				<?php 
            while (have_posts()) {
                the_post();
                $status = shandora_get_meta(get_the_ID(), 'listing_status');
                ?>
					<li>
					<article id="post-<?php 
                echo get_the_ID();
                ?>
" class="<?php 
                echo join(' ', get_post_class($status, null, false));
                ?>
" itemscope itemtype="http://schema.org/RealEstateAgent">
						<?php 
                bon_get_template_part('block', 'listing-header');
                echo '<div class="entry-summary">';
                do_atomic('entry_summary');
                echo '</div>';
                bon_get_template_part('block', 'listing-footer');
コード例 #5
0
$mileage = shandora_get_meta($post->ID, 'listing_mileage');
$price = shandora_get_meta($post->ID, 'listing_price');
$extcolor = shandora_get_meta($post->ID, 'listing_extcolor');
$intcolor = shandora_get_meta($post->ID, 'listing_intcolor');
$status = shandora_get_meta($post->ID, 'listing_status');
$fuel = shandora_get_meta($post->ID, 'listing_fueltype');
$year = shandora_get_meta($post->ID, 'listing_yearbuild');
$height = shandora_get_meta($post->ID, 'listing_height');
$width = shandora_get_meta($post->ID, 'listing_width');
$length = shandora_get_meta($post->ID, 'listing_length');
$wheelbase = shandora_get_meta($post->ID, 'listing_wheelbase');
$trackrear = shandora_get_meta($post->ID, 'listing_trackrear');
$trackfront = shandora_get_meta($post->ID, 'listing_trackfront');
$ground = shandora_get_meta($post->ID, 'listing_ground');
$seating = shandora_get_meta($post->ID, 'listing_seating');
$steering = shandora_get_meta($post->ID, 'listing_steering');
$length_measure = bon_get_option('length_measure', 'in.');
$mileage_measure = bon_get_option('mileage_measure', 'in.');
$trans_opt = shandora_get_car_search_option('transmission');
if (array_key_exists($transmission, $trans_opt)) {
    $transmission = $trans_opt[$transmission];
}
$status_opt = shandora_get_car_search_option('status');
if (array_key_exists($status, $status_opt)) {
    $status = $status_opt[$status];
}
$fuel_opt = shandora_get_car_search_option('fuel');
if (array_key_exists($fuel, $fuel_opt)) {
    $fuel = $fuel_opt[$fuel];
}
$bodytype = get_the_term_list($post->ID, 'body-type', '', ', ', '');
コード例 #6
0
ファイル: theme-actions.php プロジェクト: VadimSid/thinkgreek
function shandora_get_listing_hover_action($post_id = '')
{
    $o = '';
    if (empty($post_id)) {
        $post_id = get_the_ID();
    }
    $data_imageset = array();
    $_overlay_btns = bon_get_option('overlay_buttons', array('link' => true, 'gallery' => true, 'compare' => true));
    if (isset($_overlay_btns['gallery']) && $_overlay_btns['gallery'] == true) {
        $args = array('post_type' => 'attachment', 'numberposts' => 5, 'post_parent' => $post_id);
        $listing_gal = shandora_get_meta($post_id, 'listing_gallery');
        $imageset = '';
        if ($listing_gal) {
            $attachments = array_filter(explode(',', $listing_gal));
            if ($attachments) {
                $i = 0;
                foreach ($attachments as $attachment_id) {
                    $image_src = wp_get_attachment_image_src($attachment_id, 'full');
                    $data_imageset[$i]['src'] = $image_src[0];
                    $data_imageset[$i]['title'] = get_the_title($attachment_id);
                    $i++;
                }
            }
        }
        $imageset = json_encode($data_imageset);
    }
    if (!empty($_overlay_btns)) {
        $o = '<div class="hover-icon-wrapper">';
        if (isset($_overlay_btns['link']) && $_overlay_btns['link'] == true) {
            $o .= '<a data-tooltip data-options="disable-for-touch: true" title="' . sprintf(__('Permalink to %s', 'bon'), get_the_title($post_id)) . '" href="' . get_permalink($post_id) . '" class="hover-icon has-tip tip-top tip-centered-top"><i class="sha-link"></i></a>';
        }
        if (!empty($data_imageset) && isset($_overlay_btns['gallery']) && $_overlay_btns['gallery'] == true) {
            $o .= '<a data-tooltip data-options="disable-for-touch: true" data-imageset=\'' . $imageset . '\' title="' . __('View Image', 'bon') . '" class="has-tip tip-top top-centered-top hover-icon listing-gallery"><i class="sha-zoom"></i></a>';
        }
        if (isset($_overlay_btns['compare']) && $_overlay_btns['compare'] == true) {
            $o .= '<a data-tooltip data-options="disable-for-touch: true" title="' . __('Compare Listing', 'bon') . '" data-id=' . $post_id . ' class="hover-icon has-tip tip-top tip-centered-top listing-compare"><i class="sha-paperclip"></i></a>';
        }
        $o .= '</div>';
    }
    return $o;
}
コード例 #7
0
    /**
     * Outputs the widget based on the arguments input through the widget controls.
     *
     * @since 1.0
     */
    function widget($sidebar, $instance)
    {
        extract($sidebar);
        /* Set the $args for wp_get_archives() to the $instance array. */
        $args = $instance;
        /* Overwrite the $echo argument and set it to false. */
        $args['echo'] = false;
        if (!is_singular('listing')) {
            return;
        }
        /* Output the theme's $before_widget wrapper. */
        echo $before_widget;
        /* If a title was input by the user, display it. */
        if (!empty($instance['title'])) {
            echo $before_title . apply_filters('widget_title', $instance['title'], $instance, $this->id_base) . $after_title;
        }
        ?>
		
		<div class="row">
			<div class="column large-12 featured-listing-carousel">
				<?php 
        global $post;
        $tax_query = array();
        $meta_query = array();
        foreach ($instance['related_to'] as $related_key) {
            $prefix = bon_get_prefix();
            switch ($related_key) {
                case 'bed':
                    $beds = shandora_get_meta($post->ID, 'listing_bed');
                    if (!empty($beds)) {
                        $meta_query[] = array('key' => $prefix . 'listing_bed', 'value' => $beds, 'compare' => '<=', 'type' => 'NUMERIC');
                    }
                    break;
                case 'bath':
                    $baths = shandora_get_meta($post->ID, 'listing_bath');
                    if (!empty($baths)) {
                        $meta_query[] = array('key' => $prefix . 'listing_bath', 'value' => $baths, 'compare' => '<=', 'type' => 'NUMERIC');
                    }
                    break;
                case 'lotsize':
                    $lotsize = shandora_get_meta($post->ID, 'listing_lotsize');
                    if (!empty($lotsize)) {
                        $meta_query[] = array('key' => $prefix . 'listing_lotsize', 'value' => $lotsize, 'compare' => '<=', 'type' => 'NUMERIC');
                    }
                    break;
                case 'status':
                    $status = shandora_get_meta($post->ID, 'listing_status');
                    if (!empty($status)) {
                        $meta_query[] = array('key' => $prefix . 'listing_status', 'value' => $status, 'compare' => '=');
                    }
                    break;
                case 'price':
                    $price = shandora_get_meta($post->ID, 'listing_price');
                    if (!empty($price)) {
                        $min_price = 0;
                        if ($price > 0) {
                            $min_price = round($price / 2);
                        }
                        $status = shandora_get_meta($post->ID, 'listing_price');
                        $meta_query[] = array('key' => $prefix . 'listing_price', 'value' => array($min_price, $price), 'compare' => 'BETWEEN', 'type' => 'NUMERIC');
                    }
                    break;
                case 'type':
                    $property_types = wp_get_object_terms($post->ID, 'property-type', array('fields' => 'slugs'));
                    $tax_query[] = array('taxonomy' => 'property-type', 'field' => 'slug', 'terms' => $property_types);
                    break;
                case 'location':
                    $property_locations = wp_get_object_terms($post->ID, 'property-location', array('fields' => 'slugs'));
                    $tax_query[] = array('taxonomy' => 'property-location', 'field' => 'slug', 'terms' => $property_locations);
                    break;
                case 'feature':
                    $property_features = wp_get_object_terms($post->ID, 'property-feature', array('fields' => 'slugs'));
                    $tax_query[] = array('taxonomy' => 'property-feature', 'field' => 'slug', 'terms' => $property_features);
                    break;
            }
        }
        $meta_count = count($meta_query);
        if ($meta_count > 1) {
            $meta_query['relation'] = 'AND';
        }
        $tax_count = count($tax_query);
        if ($tax_count > 1) {
            $tax_query['relation'] = 'OR';
        }
        $query = array('post_type' => 'listing', 'posts_per_page' => $args['limit'], 'meta_query' => $meta_query, 'post__not_in' => array($post->ID), 'tax_query' => $tax_query);
        $related_query = new WP_Query($query);
        if ($related_query->have_posts()) {
            $i = 0;
            ?>

					<script>
						jQuery(document).ready(function($){
							$('#<?php 
            echo $this->id;
            ?>
-slider').flexslider({
								animation: "slide",
								controlNav: false,
								controlsContainer: "#<?php 
            echo $this->id;
            ?>
-nav"
							});
						});
					</script>
					<div id="<?php 
            echo $this->id;
            ?>
-nav" class="featured-listing-nav">
					</div>
					<div id="<?php 
            echo $this->id;
            ?>
-slider">

	        			<ul class="slides">

					<?php 
            while ($related_query->have_posts()) {
                $related_query->the_post();
                ?>
						<?php 
                if ($i == 0) {
                    ?>
							<li>
						<?php 
                }
                ?>
						
						<div class="featured-item">
							<?php 
                if (current_theme_supports('get-the-image')) {
                    get_the_image(array('size' => 'listing_medium', 'before' => '<div class="featured-image">', 'after' => '</div>'));
                }
                ?>
							<?php 
                $bed = shandora_get_meta(get_the_ID(), 'listing_bed');
                $bath = shandora_get_meta(get_the_ID(), 'listing_bath');
                ?>
							<span class="featured-item-meta hide-for-medium bed"><i class="sha-bed"></i><?php 
                echo $bed;
                ?>
</span>
							<span class="featured-item-meta hide-for-medium bath"><i class="sha-bath"></i><?php 
                echo $bath;
                ?>
</span>
							<div class="featured-item-title">
								<h2 class="title"><i class="bonicons bi-link"></i><a href="<?php 
                the_permalink();
                ?>
" title="<?php 
                the_title_attribute();
                ?>
" ><?php 
                the_title();
                ?>
</a></h2>
							</div>
						</div>
						
	                    <?php 
                $i++;
                if ($i == 3) {
                    $i = 0;
                    ?>
	                    	</li>
	                	<?php 
                }
                ?>
					<?php 
            }
            ?>
						<?php 
            if ($i > 0) {
                ?>
							</li>
						<?php 
            }
            ?>
						</ul>
						
					</div>

					<?php 
        } else {
            echo '<p>' . __('No Related listing were found', 'bon') . '</p>';
        }
        wp_reset_query();
        ?>
			</div>
		</div>

	<?php 
        /* Close the theme's widget wrapper. */
        echo $after_widget;
    }
コード例 #8
0
ファイル: loop-slider.php プロジェクト: VadimSid/thinkgreek
<?php

$slider_post_per_page = bon_get_option('slider_post_per_page', 5);
$post_in = array();
global $post;
$slideshow_ids = shandora_get_meta($post->ID, 'slideshow_ids');
$slideshow_type = shandora_get_meta($post->ID, 'slideshow_type');
$slideshow_type = $slideshow_type != '' ? $slideshow_type : 'full';
if (!empty($slideshow_ids)) {
    $post_in = explode(',', $slideshow_ids);
}
$loop = new WP_Query(array('post_type' => 'slider', 'posts_per_page' => $slider_post_per_page, 'post_status' => 'publish', 'orderby' => 'menu_order', 'order' => 'DESC', 'post__in' => $post_in));
?>

<?php 
if ($loop->have_posts()) {
    ?>
<div id="slider-container" class="container <?php 
    echo $slideshow_type;
    ?>
">

  <div class="slider-inner-container">
      
      <div id="main-slider" class="flexslider" data-interval="<?php 
    echo bon_get_option('slider_interval', 12000);
    ?>
">

        <ul class="slides">
          <?php 
コード例 #9
0
ファイル: block-slider.php プロジェクト: VadimSid/thinkgreek
<?php

$image_id = shandora_get_meta($post->ID, 'slider_image');
$image_array = wp_get_attachment_image_src($image_id, 'featured_slider');
$image_src = $image_array[0];
$subtitle = shandora_get_meta($post->ID, 'slider_subtitle');
$url = shandora_get_meta($post->ID, 'slider_linkto');
$position = shandora_get_meta($post->ID, 'slider_position');
$icon = 'sha-arrow-right';
if ($position == 'caption-right') {
    $icon = 'sha-arrow-left';
}
?>
<li>
  <div class="mask"></div>
  <img src="<?php 
echo esc_url($image_src);
?>
" alt="<?php 
the_title();
?>
" />

  <div class="flex-caption <?php 
echo $position;
?>
">
    <?php 
if (the_title('', '', false) != '') {
    ?>
    <h2 class="primary-title"><?php 
コード例 #10
0
ファイル: meta.php プロジェクト: VadimSid/thinkgreek
<?php

$length = shandora_get_meta($post->ID, 'listing_length');
$speed = shandora_get_meta($post->ID, 'listing_speed');
$fuel = shandora_get_meta($post->ID, 'listing_fuelcaps');
$people = shandora_get_meta($post->ID, 'listing_people_cap');
$terms = get_the_terms($post->ID, 'boat-engine');
$engine_types = array();
$engine_type = '';
if ($terms && !is_wp_error($terms)) {
    foreach ($terms as $term) {
        $engine_types[] = $term->name;
        break;
    }
}
if (count($engine_types) > 0) {
    $engine_type = join(' ', $engine_types);
}
?>
<ul class="large-custom-grid-5 small-custom-grid-3">
	<?php 
if (!empty($engine_type)) {
    ?>
	<li class="bed"><div class="meta-wrap">
		<i class="sha-engine"></i>
		<span class="meta-value">
			<?php 
    echo $engine_type;
    ?>
		</span></div>
	</li>
コード例 #11
0
 function shandora_manage_columns($name)
 {
     global $post;
     switch ($name) {
         case 'status':
             $s_opt = shandora_get_search_option('status');
             $status = shandora_get_meta($post->ID, 'listing_status');
             if (array_key_exists($status, $s_opt)) {
                 $status = $s_opt[$status];
             }
             echo $status;
             break;
         case 'car_status':
             $s_opt = shandora_get_car_search_option('status');
             $status = shandora_get_meta($post->ID, 'listing_status');
             if (array_key_exists($status, $s_opt)) {
                 $status = $s_opt[$status];
             }
             echo $status;
             break;
         case 'yearbuilt':
             $year = shandora_get_meta($post->ID, 'listing_yearbuild');
             echo $year;
             break;
         case 'price':
             $price = shandora_get_meta($post->ID, 'listing_price', true);
             echo $price;
             break;
         case 'propertylocation':
             $location = get_the_term_list($post->ID, 'property-location', '', ', ', '');
             echo $location;
             break;
         case 'propertytype':
             $type = get_the_term_list($post->ID, 'property-type', '', ', ', '');
             echo $type;
             break;
         case 'bodytype':
             $type = get_the_term_list($post->ID, 'body-type', '', ', ', '');
             echo $type;
             break;
     }
 }
コード例 #12
0
ファイル: tab.php プロジェクト: VadimSid/thinkgreek
$sizemeasurement = bon_get_option('measurement');
$buildingsize = shandora_get_meta($post->ID, 'listing_buildingsize');
$furnish = shandora_get_meta($post->ID, 'listing_furnishing');
$mortgage = shandora_get_meta($post->ID, 'listing_mortgage') != 'mortgage' ? __('N/A', 'bon') : __('Available', 'bon');
$garage = shandora_get_meta($post->ID, 'listing_garage');
$basement = shandora_get_meta($post->ID, 'listing_basement');
$date = shandora_get_meta($post->ID, 'listing_dateavail');
$totalroom = shandora_get_meta($post->ID, 'listing_totalroom');
$year = shandora_get_meta($post->ID, 'listing_yearbuild');
$floor = shandora_get_meta($post->ID, 'listing_floor');
$agent_ids = get_post_meta($post->ID, 'shandora_listing_agentpointed', true);
$address = shandora_get_meta($post->ID, 'listing_address');
$location = get_the_term_list($post->ID, 'property-location', '', ', ', '');
$type = get_the_term_list($post->ID, 'property-type');
$mls = shandora_get_meta($post->ID, 'listing_mls');
$zip = shandora_get_meta($post->ID, 'listing_zip');
$status_opt = shandora_get_search_option('status');
if (array_key_exists($status, $status_opt)) {
    $status = $status_opt[$status];
}
$details = apply_atomic('property_details_tab_content', array('mls' => __('MLS:', 'bon'), 'address' => __('Address:', 'bon'), 'location' => __('Location:', 'bon'), 'zip' => __('Zip:', 'bon'), 'status' => __('Status:', 'bon'), 'type' => __('Property Type:', 'bon'), 'mortgage' => __('Mortgage:', 'bon'), 'date' => __('Date Available:', 'bon'), 'year' => __('Year Built:', 'bon')));
$specs = apply_atomic('property_specifications_tab_content', array('bed' => __('Bedrooms:', 'bon'), 'bath' => __('Bathrooms:', 'bon'), 'lotsize' => __('Lot Size:', 'bon'), 'buildingsize' => __('Building Size:', 'bon'), 'garage' => __('Garage:', 'bon'), 'basement' => __('Basement:', 'bon'), 'floor' => __('Floors:', 'bon'), 'totalroom' => __('Total Rooms:', 'bon')));
?>
<section>
	<nav class="tab-nav">
		<?php 
if (!empty($details) && is_array($details)) {
    ?>
 
			<a class="active" href="#tab-target-details"><?php 
    _e('Details', 'bon');
コード例 #13
0
function shandora_render_builder_element_car_listing($value)
{
    $layout = get_theme_mod('theme_layout');
    if (empty($layout)) {
        $layout = get_post_layout(get_queried_object_id());
    }
    extract($value);
    $o = '';
    $car_ids = array();
    if ($body_type == 'all' || !empty($car_id)) {
        $body_type = '';
    }
    if ($dealer_location == 'all' || !empty($car_id)) {
        $dealer_location = '';
    }
    if ($car_feature == 'all' || !empty($car_id)) {
        $car_feature = '';
    }
    if ($manufacturer == 'all' || !empty($car_id)) {
        $manufacturer = '';
    }
    $meta_car_query = array();
    if (!empty($car_id)) {
        $car_ids = explode(',', $car_id);
    } else {
        if (isset($car_query) && $car_query != ' latest') {
            switch ($car_query) {
                case 'featured':
                    $meta_car_query = array('key' => bon_get_prefix() . 'listing_featured', 'value' => true, 'compare' => '=');
                    break;
                case 'new':
                    $meta_car_query = array('key' => bon_get_prefix() . 'listing_status', 'value' => 'new', 'compare' => '=');
                    break;
                case 'used':
                    $meta_car_query = array('key' => bon_get_prefix() . 'listing_status', 'value' => 'used', 'compare' => '=');
                    break;
                case 'certified':
                    $meta_car_query = array('key' => bon_get_prefix() . 'listing_status', 'value' => 'certified', 'compare' => '=');
                    break;
            }
        }
    }
    $car_loop = array('post_type' => 'car-listing', 'post__in' => $car_ids, 'posts_per_page' => $numberposts, 'body-type' => $body_type, 'dealer-location' => $dealer_location, 'car-feature' => $car_feature, 'manufacturer' => $manufacturer, 'meta_query' => array($meta_car_query));
    $mobile = bon_get_option('mobile_layout', '2');
    $block_cls = '4';
    if ($layout == '2c-l' || $layout == '2c-r') {
        $block_cls = '3';
    }
    $ul_class = "small-block-grid-" . $mobile . " large-block-grid-" . $block_cls;
    $compare_page = bon_get_option('compare_page');
    query_posts($car_loop);
    if (have_posts()) {
        $o .= '<div id="listings-container" class="row">';
        $o .= '<div class="' . shandora_column_class('large-12', false) . '">';
        $o .= '<ul class="listings ' . $ul_class . '" data-compareurl="' . get_permalink($compare_page) . '">';
        while (have_posts()) {
            the_post();
            $suffix = 'listing_';
            $badge = shandora_get_meta(get_the_ID(), $suffix . 'badge');
            $badgeclr = shandora_get_meta(get_the_ID(), $suffix . 'badge_color');
            $o .= '<li>';
            $o .= '<article id="post-' . get_the_ID() . '" class="' . join(' ', get_post_class($badgeclr, null, false)) . '" itemscope itemtype="http://schema.org/RealEstateAgent">';
            ob_start();
            bon_get_template_part('block', 'listing-header');
            $o .= ob_get_clean();
            $o .= '<div class="entry-summary">';
            ob_start();
            do_atomic('entry_summary');
            $o .= ob_get_clean();
            $o .= '</div>';
            ob_start();
            bon_get_template_part('block', 'listing-footer');
            $o .= ob_get_clean();
            $o .= '</article></li>';
        }
        $o .= '</ul></div></div>';
    }
    wp_reset_query();
    return $o;
}
コード例 #14
0
ファイル: meta.php プロジェクト: VadimSid/thinkgreek
<?php

$engine = shandora_get_meta($post->ID, 'listing_enginesize');
$transmission = shandora_get_meta($post->ID, 'listing_transmission');
$ancap = shandora_get_meta($post->ID, 'listing_ancap');
$mileage = shandora_get_meta($post->ID, 'listing_mileage');
$trans_opt = shandora_get_car_search_option('transmission');
if (array_key_exists($transmission, $trans_opt)) {
    $transmission = $trans_opt[$transmission];
}
$terms = get_the_terms($post->ID, 'body-type');
if ($terms && !is_wp_error($terms)) {
    foreach ($terms as $term) {
        $bodytype = $term->name;
        break;
        // to display only one body type
    }
}
?>
<ul class="large-custom-grid-5 small-custom-grid-3">
	<?php 
if (!empty($engine)) {
    ?>
	<li class="bed"><div class="meta-wrap">
		<i class="sha-engine"></i>
		<span class="meta-value">
			<?php 
    echo $engine;
    ?>
		</span></div>
	</li>
コード例 #15
0
<?php

$listing_gal = shandora_get_meta(get_the_ID(), 'listing_gallery');
$layout = get_theme_mod('theme_layout');
if ($layout == '1c') {
    $image_size = 'featured_slider';
} else {
    $image_size = 'listing_large';
}
if ($listing_gal) {
    $attachments = array_filter(explode(',', $listing_gal));
    if ($attachments) {
        ?>
<div class="entry-gallery">
	<?php 
        $with_thumbnail = bon_get_option('listing_gallery_thumbnail');
        $ul_class = 'bxslider';
        if ($with_thumbnail == 'no') {
            $ul_class = 'bxslider-no-thumb';
        } else {
            if ($with_thumbnail == 'both') {
                $ul_class = 'bxslider-both';
            }
        }
        ?>

	<ul class="<?php 
        echo $ul_class;
        ?>
">
	<?php 
コード例 #16
0
ファイル: theme-hooks.php プロジェクト: VadimSid/thinkgreek
function shandora_filter_body_class($classes)
{
    global $post;
    if (!isset($post->ID)) {
        return $classes;
    }
    $id = $post->ID;
    $class = shandora_get_meta($id, 'slideshow_type');
    if (!empty($class) && shandora_is_home() && bon_get_option('show_slider', 'show') == 'show') {
        $class = 'slider-' . $class;
        $classes[] = $class;
    } else {
        if (shandora_is_home() && bon_get_option('show_slider', 'show') == 'show') {
            $classes[] = 'slider-full';
        }
    }
    return $classes;
}
コード例 #17
0
ファイル: footer.php プロジェクト: VadimSid/thinkgreek
            ?>
</span>
					</div>
					<?php 
        }
        ?>
					<?php 
        if (shandora_get_meta($agent_id, 'agentfax')) {
            ?>
					<div class="agent-info">			
						<strong><?php 
            _e('Fax:', 'bon');
            ?>
</strong>
						<span><?php 
            echo shandora_get_meta($agent_id, 'agentfax');
            ?>
</span>
					</div>
					<?php 
        }
        ?>
				</div>
				
			</div>
			<div class="related-post">
				<div class="related-header"><strong><?php 
        printf(__('Other Listing by %s', 'bon'), get_the_title($agent_id));
        ?>
</strong><a class="more-related" href="<?php 
        echo get_permalink($agent_id);
コード例 #18
0
ファイル: meta.php プロジェクト: VadimSid/thinkgreek
<?php

$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');
$furnish = shandora_get_meta($post->ID, 'listing_furnishing');
$garage = shandora_get_meta($post->ID, 'listing_garage');
$rooms = shandora_get_meta($post->ID, 'listing_totalroom');
?>
<ul class="large-custom-grid-5 small-custom-grid-3">
	<?php 
if (!empty($bed)) {
    ?>
	<li class="bed"><div class="meta-wrap">
		<i class="sha-bed"></i>
		<span class="meta-value">
			<?php 
    $bed > 0 ? printf(_n('1 Bed', '%s Beds', $bed, 'bon'), $bed) : _e('No Bath', 'bon');
    ?>
		</span></div>
	</li>
	<?php 
}
?>
	<?php 
if (!empty($bath)) {
    ?>
	<li class="bath"><div class="meta-wrap">
		<i class="sha-bath"></i>
コード例 #19
0
ファイル: loop-listing.php プロジェクト: VadimSid/thinkgreek
                if (has_post_thumbnail($post->ID)) {
                    $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'thumbnail');
                    $image = $image[0];
                } else {
                    $args = array('post_type' => 'attachment', 'numberposts' => 1, 'post_parent' => $post->ID);
                    $attachments = get_posts($args);
                    if ($attachments && is_array($attachments)) {
                        $image = wp_get_attachment_image_src($attachments[0]->ID, 'thumbnail');
                        $image = $image[0];
                    } else {
                        $image = '';
                    }
                }
                $bath = shandora_get_meta($post->ID, 'listing_bath');
                $bed = shandora_get_meta($post->ID, 'listing_bed');
                $data_map[] = array('photo' => !empty($image) ? $image : '', 'baths' => !empty($bath) ? sprintf(_n('%s Bath', '%s Baths', $bath, 'bon'), $bath) : __('0 Bath', 'bon'), 'beds' => !empty($bed) ? sprintf(_n('%s Bed', '%s Beds', $bed, 'bon'), $bed) : __('0 Bed', 'bon'), 'lotsize' => shandora_get_meta($post->ID, 'listing_lotsize') != '' ? shandora_get_meta($post->ID, 'listing_lotsize') . ' ' . $sizemeasurement : 'N\\A', 'price' => shandora_get_listing_price(false), 'permalink' => get_permalink(), 'title' => get_the_title(), 'id' => get_the_ID(), 'latitude' => $lat, 'longitude' => $long);
            }
        }
        ?>

        <?php 
        bon_get_template_part('content', 'listing');
        ?>

    <?php 
    }
    $count = $wp_query->found_posts;
    $content_count = sprintf(_n('%s Property Listed', '%s Properties Listed', $count, 'bon'), $count);
    $show_listing_count = bon_get_option('show_listing_count', 'no');
    if ($content_count && $show_listing_count == 'yes') {
        ?>
コード例 #20
0
ファイル: content-agent.php プロジェクト: VadimSid/thinkgreek
<?php

$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_lotsize');
$sizemeasurement = bon_get_option('measurement');
$agent_pic = shandora_get_meta($post->ID, 'agentpic');
$agent_fb = shandora_get_meta($post->ID, 'agentfb');
$agent_tw = shandora_get_meta($post->ID, 'agenttw');
$agent_li = shandora_get_meta($post->ID, 'agentlinkedin');
$agent_mobile = shandora_get_meta($post->ID, 'agentmobilephone');
$agent_office = shandora_get_meta($post->ID, 'agentofficephone');
$agent_fax = shandora_get_meta($post->ID, 'agentfax');
$agent_email = shandora_get_meta($post->ID, 'agentemail');
$agent_job = shandora_get_meta($post->ID, 'agentjob');
if (is_singular(get_post_type())) {
    ?>
<article id="post-<?php 
    the_ID();
    ?>
" <?php 
    post_class($status);
    ?>
 itemscope itemtype="http://schema.org/RealEstateAgent">
	<header class="entry-header clear">
		<h1 class="entry-title" itemprop="name"><?php 
    the_title();
    ?>
			<?php 
    if (!empty($agent_job)) {
コード例 #21
0
<?php

$suffix = 'listing_';
$status = shandora_get_meta($post->ID, $suffix . 'status');
$status_key = shandora_get_meta($post->ID, $suffix . 'status');
$badge = shandora_get_meta($post->ID, $suffix . 'badge');
$badgeclr = shandora_get_meta($post->ID, $suffix . 'badge_color');
$status_opt = shandora_get_car_search_option('status');
if (array_key_exists($status, $status_opt)) {
    $status = $status_opt[$status];
}
if (is_singular(get_post_type())) {
    ?>
<article id="post-<?php 
    the_ID();
    ?>
" <?php 
    post_class($status_key . ' listing');
    ?>
 itemscope itemtype="http://schema.org/AutoDealer">
	<header class="entry-header clear">
		<?php 
    echo apply_atomic_shortcode('entry_title', the_title('<h1 class="entry-title" itemprop="name">', '</h1>', false));
    ?>
		
		<a class="print" href="javascript:window.print()"><i class="sha-printer"></i></a>
		<?php 
    echo apply_atomic_shortcode('entry_fav', '[bon-fav]');
    ?>
		<?php 
    echo apply_atomic_shortcode('listing_published', '[entry-published before="<div class=\'show-for-large\'>" after="</div>" text="' . __('Published on ', 'bon') . '"]');
コード例 #22
0
ファイル: block-related.php プロジェクト: VadimSid/thinkgreek
</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>
<article id="post-<?php 
        $post->ID;
        ?>
" <?php 
        post_class($status);
        ?>
 itemscope itemtype="http://schema.org/RealEstateAgent">
	<header class="entry-header">
		<div class="listing-hover">
			<span class="mask"></span>
			<?php 
        echo shandora_get_listing_hover_action($post->ID);
コード例 #23
0
 $zip = shandora_get_meta($post->ID, 'listing_zip');
 $address = shandora_get_meta($post->ID, 'listing_address');
 $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_lotsize');
 $buildingsize = shandora_get_meta($post->ID, 'listing_buildingsize');
 $furnish = shandora_get_meta($post->ID, 'listing_furnishing');
 $mortgage = shandora_get_meta($post->ID, 'listing_mortgage');
 $mortgage = $mortgage == 'nomortgage' ? __('N/A', 'bon') : __('Available', 'bon');
 $garage = shandora_get_meta($post->ID, 'listing_garage');
 $basement = shandora_get_meta($post->ID, 'listing_basement');
 $date = shandora_get_meta($post->ID, 'listing_dateavail');
 $totalroom = shandora_get_meta($post->ID, 'listing_totalroom');
 $year = shandora_get_meta($post->ID, 'listing_yearbuild');
 $floor = shandora_get_meta($post->ID, 'listing_floor');
 $agent_ids = get_post_meta($post->ID, bon_get_prefix() . 'listing_agentpointed', true);
 $link = '<a class="button red flat radius" href="' . get_permalink($post->ID) . '" title="' . get_the_title($post->ID) . '">' . __('View Property', 'bon') . '</a>';
 $agent = '';
 if (is_array($agent_ids)) {
     $len = count($agent_ids);
     $i = 1;
     foreach ($agent_ids as $agent_id) {
         if ($len > 1 && $i < $len) {
             $agent .= get_the_title($agent_id) . ', ';
         } else {
             $agent .= get_the_title($agent_id);
         }
         $i++;
     }
 }