Exemplo n.º 1
0
    function wpestate_present_theme_slider()
    {
        $attr = array('class' => 'img-responsive');
        $theme_slider = get_option('wp_estate_theme_slider', '');
        if (empty($theme_slider)) {
            return;
            // no listings in slider - just return
        }
        $currency = esc_html(get_option('wp_estate_currency_symbol', ''));
        $where_currency = esc_html(get_option('wp_estate_where_currency_symbol', ''));
        $counter = 0;
        $slides = '';
        $indicators = '';
        $args = array('post_type' => 'estate_property', 'post_status' => 'publish', 'post__in' => $theme_slider);
        $recent_posts = new WP_Query($args);
        $slider_cycle = get_option('wp_estate_slider_cycle', true);
        if ($slider_cycle == 0) {
            $slider_cycle = false;
        }
        $extended_search = get_option('wp_estate_show_adv_search_extended', '');
        $extended_class = '';
        if ($extended_search == 'yes') {
            $extended_class = 'theme_slider_extended';
        }
        $search_type = get_option('wp_estate_adv_search_type', '');
        $theme_slider_class = '';
        if ($search_type != 'oldtype') {
            $theme_slider_class = 'theme_slider_wrapper_type2';
        }
        print '<div class="theme_slider_wrapper ' . $theme_slider_class . ' ' . $extended_class . ' carousel  slide" data-ride="carousel" data-interval="' . $slider_cycle . '" id="estate-carousel">';
        while ($recent_posts->have_posts()) {
            $recent_posts->the_post();
            $theid = get_the_ID();
            $slide = get_the_post_thumbnail($theid, 'wpestate_property_full_map', $attr);
            if ($counter == 0) {
                $active = " active ";
            } else {
                $active = " ";
            }
            $measure_sys = get_option('wp_estate_measure_sys', '');
            $beds = intval(get_post_meta($theid, 'property_bedrooms', true));
            $baths = intval(get_post_meta($theid, 'property_bathrooms', true));
            $size = number_format(intval(get_post_meta($theid, 'property_size', true)));
            if ($measure_sys == 'ft') {
                $size .= ' ' . esc_html__('ft', 'wpestate') . '<sup>2</sup>';
            } else {
                $size .= ' ' . esc_html__('m', 'wpestate') . '<sup>2</sup>';
            }
            $slides .= '
            <div class="item ' . $active . '">
               
                <div class="slider-content-wrapper">  
                    <div class="slider-content">
                        <div class="slider-title">
                            <h2><a href="' . esc_url(get_permalink()) . '">' . get_the_title() . '</a> </h2>
                        </div>

                        <div class="listing-desc-slider"> 
                            <span>' . wpestate_strip_words(get_the_excerpt(), 17) . ' ... </span>
                        </div>
                        
                        <div class="theme-slider-price">
                            <div class="price-slider-wrapper">
                                <span class="price-slider">' . wpestate_show_price($theid, $currency, $where_currency, 1) . '</span>/' . esc_html__('night', 'wpestate') . '
                            </div>        
                        </div>
                            
                        <a class="theme-slider-view" href="' . esc_url(get_permalink()) . '">' . esc_html__('View more', 'wpestate') . '</a>
                            
                    </div> 
                </div>  
                
                <div class="slider-content-cover"></div>  
                
                <a href="' . esc_url(get_permalink()) . '"> ' . $slide . '</a>

            </div>';
            $indicators .= '
            <li data-target="#estate-carousel" data-slide-to="' . $counter . '" class="' . $active . '">
            </li>';
            $counter++;
        }
        wp_reset_query();
        print ' 
            <div class="carousel-inner">
              ' . $slides . '
            </div>

            <ol class="carousel-indicators">
                ' . $indicators . '
            </ol>

                <a id="carousel-control-theme-next"  class="carousel-control-theme-next" href="#estate-carousel" data-slide="next"><i class="fa fa-angle-right"></i></a>
                <a id="carousel-control-theme-prev"  class="carousel-control-theme-prev" href="#estate-carousel" data-slide="prev"><i class="fa fa-angle-left"></i></a>
            </div>';
    }
Exemplo n.º 2
0
 function wpestate_populate_columns($column)
 {
     if ('estate_status' == $column) {
         $estate_status = get_post_status(get_the_ID());
         if ($estate_status == 'publish') {
             echo esc_html__('published', 'wpestate');
         } else {
             echo $estate_status;
         }
         $pay_status = get_post_meta(get_the_ID(), 'pay_status', true);
         if ($pay_status != '') {
             echo " | " . $pay_status;
         }
     }
     if ('estate_autor' == $column) {
         $user_id = wpsestate_get_author(get_the_ID());
         $estate_autor = get_the_author_meta('display_name');
         echo '<a href="' . get_edit_user_link($user_id) . '" >' . $estate_autor . '</a>';
     }
     if ('estate_action' == $column) {
         $estate_action = get_the_term_list(get_the_ID(), 'property_action_category', '', ', ', '');
         echo $estate_action;
     } elseif ('estate_category' == $column) {
         $estate_category = get_the_term_list(get_the_ID(), 'property_category', '', ', ', '');
         echo $estate_category;
     }
     if ('estate_price' == $column) {
         $currency = esc_html(get_option('wp_estate_currency_symbol', ''));
         $where_currency = esc_html(get_option('wp_estate_where_currency_symbol', ''));
         wpestate_show_price(get_the_ID(), $currency, $where_currency, 0);
     }
 }
Exemplo n.º 3
0
        
            <div class="listing_main_image_price">
                <?php 
$value = get_option('wp_estate_prices_per', '');
// CUSTOM MOD (switch)
switch ($value) {
    case 'day':
        wpestate_show_price($post->ID, $currency, $where_currency, 0);
        echo ' ' . esc_html__('per night', 'wpestate');
        break;
    case 'week':
        wpestate_show_price($post->ID, $currency, $where_currency, 0);
        echo ' ' . esc_html__('per week', 'wpestate');
        break;
    case 'month':
        wpestate_show_price($post->ID, $currency, $where_currency, 0);
        echo ' ' . esc_html__('per month', 'wpestate');
        break;
}
?>
            </div>
        
            <div class="booking_form_request" id="booking_form_request">
            <div id="booking_form_request_mess"></div>
            <h3 ><?php 
esc_html_e('Book Now', 'wpestate');
?>
</h3>
             
                <div class="has_calendar calendar_icon">
                    <input type="text" id="start_date" placeholder="<?php 
Exemplo n.º 4
0
 function wpestate_pin_unit_creation($the_id, $currency, $where_currency, $counter)
 {
     ////////////////////////////////////// gathering data for markups
     $gmap_lat = esc_html(get_post_meta($the_id, 'property_latitude', true));
     $gmap_long = esc_html(get_post_meta($the_id, 'property_longitude', true));
     //////////////////////////////////////  get property type
     $slug = array();
     $prop_type = array();
     $prop_city = array();
     $prop_area = array();
     $types = get_the_terms($the_id, 'property_category');
     $types_act = get_the_terms($the_id, 'property_action_category');
     $city_tax = get_the_terms($the_id, 'property_city');
     $area_tax = get_the_terms($the_id, 'property_area');
     $prop_type_name = array();
     if ($types && !is_wp_error($types)) {
         foreach ($types as $single_type) {
             $prop_type[] = $single_type->slug;
             $prop_type_name[] = $single_type->name;
             $slug = $single_type->slug;
         }
         $single_first_type = $prop_type[0];
         $single_first_type_name = ucwords($prop_type_name[0]);
     } else {
         $single_first_type = '';
         $single_first_type_name = '';
     }
     ////////////////////////////////////// get property action
     $prop_action = array();
     $prop_action_name = array();
     if ($types_act && !is_wp_error($types_act)) {
         foreach ($types_act as $single_type) {
             $prop_action[] = $single_type->slug;
             $prop_action_name[] = $single_type->name;
             $slug = $single_type->slug;
         }
         $single_first_action = $prop_action[0];
         $single_first_action_name = ucwords($prop_action_name[0]);
     } else {
         $single_first_action = '';
         $single_first_action_name = '';
     }
     /////////////////////////////////////////////////////////////////
     // add city
     if ($city_tax && !is_wp_error($city_tax)) {
         foreach ($city_tax as $single_city) {
             $prop_city[] = $single_city->slug;
         }
         $city = $prop_city[0];
     } else {
         $city = '';
     }
     ///////////////////////////////////////  ////////////////////////
     //add area
     if ($area_tax && !is_wp_error($area_tax)) {
         foreach ($area_tax as $single_area) {
             $prop_area[] = $single_area->slug;
         }
         $area = $prop_area[0];
     } else {
         $area = '';
     }
     // composing name of the pin
     if ($single_first_type == '' || $single_first_action == '') {
         $pin = sanitize_key(wpestate_limit54($single_first_type . $single_first_action));
     } else {
         $pin = sanitize_key(wpestate_limit27($single_first_type)) . sanitize_key(wpestate_limit27($single_first_action));
     }
     //// get price
     $price = intval(get_post_meta($the_id, 'property_price', true));
     $price_label = esc_html(get_post_meta($the_id, 'property_label', true));
     $clean_price = intval(get_post_meta($the_id, 'property_price', true));
     $price = wpestate_show_price($the_id, $currency, $where_currency, 1);
     $rooms = get_post_meta($the_id, 'property_bedrooms', true);
     $guest_no = get_post_meta($the_id, 'guest_no', true);
     $size = get_post_meta($the_id, 'property_size', true);
     if ($size != '') {
         $size = number_format(intval($size));
     }
     $place_markers = array();
     $place_markers[] = rawurlencode(get_the_title());
     //0
     $place_markers[] = $gmap_lat;
     //1
     $place_markers[] = $gmap_long;
     //2
     $place_markers[] = $counter;
     //3
     $post_thumbnail_id = get_post_thumbnail_id($the_id);
     $post_thumbnail_url = wp_get_attachment_url($post_thumbnail_id, 'wpestate_property_listings');
     //$place_markers[]    = rawurlencode ( get_the_post_thumbnail($the_id,'wpestate_property_listings') );////4
     $place_markers[] = rawurlencode($post_thumbnail_url);
     ////4
     $place_markers[] = rawurlencode($price);
     //5
     $place_markers[] = rawurlencode($single_first_type);
     //6
     $place_markers[] = rawurlencode($single_first_action);
     //7
     $place_markers[] = rawurlencode($pin);
     //8
     $place_markers[] = rawurlencode(esc_url(get_permalink()));
     //9
     $place_markers[] = $the_id;
     //10
     $place_markers[] = rawurlencode($city);
     //11
     $place_markers[] = rawurlencode($area);
     //12
     $place_markers[] = $clean_price;
     //13
     $place_markers[] = $rooms;
     //14
     $place_markers[] = $guest_no;
     //15
     $place_markers[] = $size;
     //16
     $place_markers[] = rawurlencode($single_first_type_name);
     //17
     $place_markers[] = rawurlencode($single_first_action_name);
     //18
     return $place_markers;
 }