/** * Get Entry Title * * @since 1.3.5 * @return void * */ function shandora_listing_entry_title() { global $post; $price = ''; if (isset($_GET['view']) && $_GET['view'] == 'list') { $price = '<a href="' . get_permalink($post->ID) . '" title="' . the_title_attribute(array('before' => __('Permalink to ', 'bon'), 'echo' => false)) . '"><span class="price">' . shandora_get_listing_price(false) . '</span></a>'; } echo apply_atomic_shortcode('entry_title', the_title('<h3 class="entry-title" itemprop="name"><a href="' . get_permalink() . '" title="' . the_title_attribute(array('before' => __('Permalink to ', 'bon'), 'echo' => false)) . '">', '</a>' . $price . '</h3>', false)); }
?> 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 --> <?php do_atomic('before_single_entry_content'); ?> <div class="entry-content clear" itemprop="description"> <?php the_content(); ?> <?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') . '"]'); ?> <h4 class="price"><?php shandora_get_listing_price(); ?> </h4> <?php $price2 = shandora_get_listing_price(false, true); ?> <?php if (!empty($price2)) { ?> <h4 class="price secondary"><?php echo $price2; ?> </h4> <?php } ?> </header><!-- .entry-header --> <?php do_atomic('before_single_entry_content');
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') { ?>
function shandora_render_builder_element_listing($value) { $layout = get_theme_mod('theme_layout'); if (empty($layout)) { $layout = get_post_layout(get_queried_object_id()); } extract($value); $o = ''; $property_ids = array(); if ($property_type == 'all' || !empty($property_id)) { $property_type = ''; } if ($property_location == 'all' || !empty($property_id)) { $property_location = ''; } if ($property_feature == 'all' || !empty($property_id)) { $property_feature = ''; } $enabled_map = false; if (isset($show_map) && $show_map == 'yes') { $enabled_map = true; } $meta_property_query = array(); if (!empty($property_id)) { $property_ids = explode(',', $property_id); } else { if (isset($property_query) && $property_query != ' latest') { switch ($property_query) { case 'featured': $meta_property_query = array('key' => bon_get_prefix() . 'listing_featured', 'value' => true, 'compare' => '='); break; case 'none': $meta_property_query = array('key' => bon_get_prefix() . 'listing_status', 'value' => 'none', 'compare' => '='); break; case 'for-rent': $meta_property_query = array('key' => bon_get_prefix() . 'listing_status', 'value' => 'for-rent', 'compare' => '='); break; case 'for-sale': $meta_property_query = array('key' => bon_get_prefix() . 'listing_status', 'value' => 'for-sale', 'compare' => '='); break; case 'reduced': $meta_property_query = array('key' => bon_get_prefix() . 'listing_status', 'value' => 'reduced', 'compare' => '='); break; case 'new': $meta_property_query = array('key' => bon_get_prefix() . 'listing_status', 'value' => 'new', 'compare' => '='); break; case 'sold': $meta_property_query = array('key' => bon_get_prefix() . 'listing_status', 'value' => 'sold', 'compare' => '='); break; case 'on-show': $meta_property_query = array('key' => bon_get_prefix() . 'listing_status', 'value' => 'on-show', 'compare' => '='); break; } } } $loop = array('post_type' => 'listing', 'post__in' => $property_ids, 'posts_per_page' => $numberposts, 'property-type' => $property_type, 'property-location' => $property_location, 'property-feature' => $property_feature, 'meta_query' => array($meta_property_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($loop); if (have_posts()) { $o .= '<div id="listings-container" class="row">'; $o .= '<div class="' . shandora_column_class('large-12', false) . '">'; $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'; } if ($enabled_map == 'yes') { $o .= '<div id="listings-map" data-show-zoom="' . $show_zoom . '" data-show-map-type="' . $show_type . '"></div>'; } $o .= '<ul class="listings ' . $ul_class . '" data-compareurl="' . get_permalink($compare_page) . '">'; $sizemeasurement = bon_get_option('measurement'); while (have_posts()) { the_post(); $status = shandora_get_meta(get_the_ID(), 'listing_status'); if ($enabled_map == 'yes') { $lat = shandora_get_meta(get_the_ID(), 'listing_maplatitude'); $long = shandora_get_meta(get_the_ID(), 'listing_maplongitude'); if (!empty($lat) && !empty($long)) { if (has_post_thumbnail(get_the_ID())) { $image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'thumbnail'); $image = $image[0]; } else { $args = array('post_type' => 'attachment', 'numberposts' => 1, 'post_parent' => get_the_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(get_the_ID(), 'listing_bath'); $bed = shandora_get_meta(get_the_ID(), 'listing_bed'); $data_map[] = array('photo' => !empty($image) ? $image : '', 'baths' => !empty($bath) ? sprintf(_n('%s Bath', '%s Baths', $bath, 'bon'), $bath) : "", 'beds' => !empty($bed) ? sprintf(_n('%s Bed', '%s Beds', $bed, 'bon'), $bed) : "", 'lotsize' => shandora_get_meta(get_the_ID(), 'listing_lotsize') != '' ? shandora_get_meta(get_the_ID(), 'listing_lotsize') . ' ' . $sizemeasurement : '', 'price' => shandora_get_listing_price(false), 'permalink' => get_permalink(), 'title' => get_the_title(), 'id' => get_the_ID(), 'latitude' => $lat, 'longitude' => $long); } } $o .= '<li>'; $o .= '<article id="post-' . get_the_ID() . '" class="' . join(' ', get_post_class($status, 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>'; } if (isset($data_map) && !empty($data_map) && is_array($data_map)) { $data_map = json_encode($data_map); $o .= '<script type="text/javascript">/* <![CDATA[ */'; $o .= 'var shandora_data = {\'results\': ' . $data_map . '}; /* ]]> */</script>'; } $o .= '</ul></div></div>'; } wp_reset_query(); return $o; }
if (current_theme_supports('get-the-image')) { $featured .= get_the_image(array('size' => 'listing_medium', 'echo' => false)); } $terms = get_the_terms(get_the_ID(), "property-type"); $type = ''; if ($terms && !is_wp_error($terms)) { foreach ($terms as $term) { $type .= '<a class="property-type" href="' . get_term_link($term->slug, "property-type") . '">' . $term->name . '</a>'; break; // to display only one property type } } $output_zip .= '<td>' . $zip . '</td>'; $output_address .= '<td>' . $address . '</td>'; $output_mls .= '<td><strong>' . $mls . '</strong></td>'; $output_price .= '<td>' . shandora_get_listing_price(false) . '</td>'; if ($status != 'none') { $status_opt = shandora_get_search_option('status'); if (array_key_exists($status, $status_opt)) { $output_status .= '<td>' . $status_opt[$status] . '</td>'; } } else { $output_status .= '<td>' . __('None', 'bon') . '</td>'; } $output_bed .= '<td>' . $bed . '</td>'; $output_bath .= '<td>' . $bath . '</td>'; $output_garage .= '<td>' . $garage . '</td>'; $output_basement .= '<td>' . $basement . '</td>'; $output_furnish .= '<td>' . $furnish . '</td>'; $output_mortgage .= '<td>' . $mortgage . '</td>'; $output_lotsize .= '<td>' . $lotsize . ' ' . $sizemeasurement . '</td>';