function st_vc_slide_location($attr, $content = false)
 {
     $data = shortcode_atts(array('st_type' => '', 'is_featured' => 'no', 'st_number' => 4, 'st_list_location' => 0, 'st_weather' => 'no', 'st_style' => 'style_1', 'st_height' => 'full', 'effect' => 'fade'), $attr, 'st_slide_location');
     extract($data);
     $query = array('post_type' => 'location');
     if ($is_featured == 'yes') {
         $query['posts_per_page'] = $st_number;
         $query['orderby'] = 'meta_value_num';
         $query['meta_query'] = array(array('key' => 'is_featured', 'value' => 'on', 'compare' => '='));
     } else {
         $ids = explode(',', $st_list_location);
         $query['post__in'] = $ids;
     }
     query_posts($query);
     $txt = '';
     while (have_posts()) {
         the_post();
         if ($st_style == 'style_1') {
             $txt .= st()->load_template('vc-elements/st-slide-location/loop-style', '1', $data);
         }
         if ($st_style == 'style_2') {
             $txt .= st()->load_template('vc-elements/st-slide-location/loop-style', '2', $data);
         }
     }
     wp_reset_query();
     if ($st_height == 'full') {
         $class = 'top-area show-onload';
     } else {
         $class = 'special-area';
     }
     if ($st_style == 'style_1') {
         $r = '<div class="' . $class . '">
                 <div class="owl-carousel owl-slider owl-carousel-area" id="owl-carousel-slider" data-effect="' . $effect . '">
                 ' . $txt . '
                 </div>
               </div>';
     }
     if ($st_style == 'style_2') {
         $r = '<div class="' . $class . '">
             <div class="bg-holder full">
                 <div class="bg-front bg-front-mob-rel">
                     <div class="container">
                     ' . st()->load_template('vc-elements/st-search/search', 'form', array('st_style_search' => 'style_2', 'st_box_shadow' => 'no', 'class' => 'search-tabs-abs mt50', 'title' => STLanguage::st_get_language('find_your_perfect_trip'))) . '
                     </div>
                 </div>
                 <div class="owl-carousel owl-slider owl-carousel-area visible-lg" id="owl-carousel-slider" data-effect="' . $effect . '">
                   ' . $txt . '
                 </div>
             </div>
         </div>';
     }
     if (empty($txt)) {
         $r = "";
     }
     return $r;
 }
Esempio n. 2
0
                <div class="col-md-5 col-sm-5 col-xs-5">
                    <i class="fa fa-map-marker"> &nbsp;</i>
                    <?php 
$address = get_post_meta(get_the_ID(), 'address', true);
?>
                    <?php 
if (!empty($address)) {
    echo esc_html($address);
}
?>
                </div>
                <div class="col-md-7 col-sm-7 col-xs-7 text-right">
                    <div class="package-info">
                        <i class="fa fa-calendar">&nbsp;</i>
                        <span class=""><?php 
STLanguage::st_the_language('holiday_date');
?>
: </span>
                        <?php 
$type_holiday = get_post_meta(get_the_ID(), 'type_holiday', true);
if ($type_holiday == 'daily_holiday') {
    $day = STHoliday::get_duration_unit();
    echo esc_html($day);
} else {
    $check_in = get_post_meta(get_the_ID(), 'check_in', true);
    $check_out = get_post_meta(get_the_ID(), 'check_out', true);
    if (!empty($check_in) and !empty($check_out)) {
        $date = date_i18n(TravelHelper::getDateFormat(), strtotime($check_in)) . ' <i class="fa fa-long-arrow-right"></i> ' . date_i18n(TravelHelper::getDateFormat(), strtotime($check_out));
        echo balanceTags($date);
    } else {
        st_the_language('holiday_none');
Esempio n. 3
0
    ?>
           <header class="thumb-header">
               <a href="<?php 
    the_permalink();
    ?>
" class="hover-img">
                   <?php 
    $img = get_the_post_thumbnail(get_the_ID(), array(800, 600, 'bfi_thumb' => true));
    if (!empty($img)) {
        echo balanceTags($img);
    } else {
        echo '<img width="800" height="600" alt="no-image" class="wp-post-image" src="' . bfi_thumb(get_template_directory_uri() . '/img/no-image.png', array('width' => 800, 'height' => 600)) . '">';
    }
    ?>
                   <h5 class="hover-title-center"><?php 
    STLanguage::st_the_language('book_now');
    ?>
</h5>
               </a>
           </header>
           <div class="thumb-caption">
               <ul class="icon-group text-tiny text-color">
                   <?php 
    echo TravelHelper::rate_to_string(STReview::get_avg_rate());
    ?>
               </ul>
               <h5 class="thumb-title">
                   <a href="<?php 
    the_permalink();
    ?>
" class="text-darken">
Esempio n. 4
0
        } else {
            $link = home_url(esc_url('?s=&post_type=st_activity&location_id=' . get_the_ID()));
        }
        if ($offer < 2) {
            $offer = $offer . " " . __("Activity this Week", ST_TEXTDOMAIN);
        } else {
            $offer = $offer . " " . __("Activities this Week", ST_TEXTDOMAIN);
        }
        echo '<li><a href="' . $link . '"><i class="fa fa-bolt"></i> ' . $offer . '</a></li>';
    }
}
?>
    </ul>
    <?php 
$page_search = st_get_page_search_result($st_type);
if (!empty($page_search)) {
    $link = add_query_arg(array('location_id' => get_the_ID()), get_the_permalink($page_search));
} else {
    $link = home_url(esc_url('?s=&post_type=' . $st_type . '&location_id=' . get_the_ID()));
}
?>
    <a class="btn btn-white btn-ghost mt10" href="<?php 
echo esc_url($link);
?>
">
        <i class="fa fa-angle-right"></i>
        <?php 
echo STLanguage::st_get_language('explore');
?>
    </a>
</div>
Esempio n. 5
0
 function st_the_language($key)
 {
     if (class_exists('STLanguage')) {
         STLanguage::st_the_language($key);
     } else {
         global $st_language;
         if (!empty($st_language[$key])) {
             echo balanceTags($st_language[$key]);
         } else {
             echo balanceTags($key);
         }
     }
 }
Esempio n. 6
0
                <?php 
$img = get_the_post_thumbnail(get_the_ID(), array(800, 600, 'bfi_thumb' => true));
if (!empty($img)) {
    echo balanceTags($img);
} else {
    echo '<img width="800" height="600" alt="no-image" class="wp-post-image" src="' . get_template_directory_uri() . '/img/no-image.png">';
}
?>
                <h5 class="hover-title-top-left hover-hold"><?php 
the_title();
?>
</h5>
            </a>
        </header>
        <div class="thumb-caption text-center">
            <p class="thumb-desc"><?php 
the_excerpt();
?>
</p>
            <a class="btn btn-default btn-ghost mt10" href="<?php 
the_permalink();
?>
">
                <?php 
STLanguage::st_the_language('read_more');
?>
                <i class="fa fa-angle-right"></i>
            </a>
        </div>
    </div>
</div>
Esempio n. 7
0
        echo '<i class="fa fa-map-marker"></i> ';
        echo esc_html($address);
        echo '</div>';
    }
    ?>

                       <div class="col-md-7 col-sm-7 col-xs-7 <?php 
    if ($address) {
        echo 'text-right';
    }
    ?>
">
                           <div class="package-info">
                               <i class="fa fa-calendar"></i>
                               <span class=""><?php 
    STLanguage::st_the_language('tour_date');
    ?>
: </span>
                               <?php 
    $type_tour = get_post_meta(get_the_ID(), 'type_tour', true);
    if ($type_tour == 'daily_tour') {
        $day = STTour::get_duration_unit();
        echo esc_html($day);
    } else {
        $check_in = get_post_meta(get_the_ID(), 'check_in', true);
        $check_out = get_post_meta(get_the_ID(), 'check_out', true);
        if (!empty($check_in) and !empty($check_out)) {
            $format = TravelHelper::getDateFormat();
            $date = date_i18n($format, strtotime($check_in)) . ' <i class="fa fa-long-arrow-right"></i> ' . date_i18n($format, strtotime($check_out));
            echo balanceTags($date);
        } else {
Esempio n. 8
0
 function st_vc_slide_location($attr, $content = false)
 {
     $data = shortcode_atts(array('st_type' => '', 'is_featured' => 'no', 'st_number' => 4, 'st_list_location' => 0, 'st_weather' => 'no', 'st_style' => 'style_1', 'st_height' => 'full', 'effect' => 'fade', 'link_to' => 'page_search', 'st_location_type' => ''), $attr, 'st_slide_location');
     extract($data);
     $query = array('post_type' => 'location', 'posts_per_page' => -1);
     if ($is_featured == 'yes') {
         $query['posts_per_page'] = $st_number;
         $query['orderby'] = 'meta_value_num';
         $query['meta_query'] = array(array('key' => 'is_featured', 'value' => 'on', 'compare' => '='));
     } else {
         $ids = explode(',', $st_list_location);
         if (is_array($ids)) {
             $query['post__in'] = $ids;
         }
     }
     if ($st_location_type) {
         $tax_query = array();
         $st_location_type = explode(',', $st_location_type);
         $tmp = array();
         if (!empty($st_location_type) and is_array($st_location_type)) {
             foreach ($st_location_type as $key => $value) {
                 $value = explode('/', $value);
                 $tmp[] = $value;
             }
         }
         $tmp_term = array();
         $tmp_tax = array();
         if (!empty($tmp) and is_array($tmp)) {
             foreach ($tmp as $key => $value) {
                 if ($key == 0 or !in_array($value[0], $tmp_tax)) {
                     $tmp_tax[] = $value[0];
                     $tmp_term[$value[0]] = array($value[1]);
                 } else {
                     if (in_array($value[0], $tmp_tax)) {
                         $type = $value[0];
                         $tmp_term[$type][] = $value[1];
                     }
                 }
             }
         }
         if (!empty($tmp_term) and is_array($tmp_term)) {
             foreach ($tmp_term as $key => $value) {
                 $query['tax_query'][] = array('taxonomy' => $key, 'field' => 'id', 'terms' => $value, 'operator' => "IN");
             }
             $query['tax_query']['relation'] = "AND";
         }
     }
     query_posts($query);
     $txt = '';
     while (have_posts()) {
         the_post();
         if ($st_style == 'style_1') {
             $txt .= st()->load_template('vc-elements/st-slide-location/loop-style', '1', $data);
         }
         if ($st_style == 'style_2') {
             $txt .= st()->load_template('vc-elements/st-slide-location/loop-style', '2', $data);
         }
     }
     wp_reset_query();
     if ($st_height == 'full') {
         $class = 'top-area show-onload';
     } else {
         $class = 'special-area';
     }
     if ($st_style == 'style_1') {
         $r = '<div class="' . $class . '">
                 <div class="owl-carousel owl-slider owl-carousel-area" id="owl-carousel-slider" data-effect="' . $effect . '">
                 ' . $txt . '
                 </div>
               </div>';
     }
     $bgr = "";
     if (!empty($ids[0])) {
         $bgr_url = wp_get_attachment_image_src(get_post_thumbnail_id($ids[0]), 'full');
         $bgr_url = $bgr_url[0];
         $bgr = " style='background-image: url(" . $bgr_url . ")'";
     }
     if ($st_style == 'style_2') {
         $r = '<div class="' . $class . '">
             <div class="bg-holder full st-slider-location"' . $bgr . ' >
                 <div class="bg-front bg-front-mob-rel">
                     <div class="container">
                     ' . st()->load_template('vc-elements/st-search/search', 'form', array('st_style_search' => 'style_2', 'st_box_shadow' => 'no', 'class' => 'search-tabs-abs mt50', 'title' => STLanguage::st_get_language('find_your_perfect_trip'))) . '
                     </div>
                 </div>
                 <div class="owl-carousel owl-slider owl-carousel-area visible-lg" id="owl-carousel-slider" data-effect="' . $effect . '">
                   ' . $txt . '
                 </div>
             </div>
         </div>';
     }
     if (empty($txt)) {
         $r = "";
     }
     return $r;
 }
Esempio n. 9
0
}
?>
                    </ul>

                <?php 
$page_search = st_get_page_search_result($st_type);
if (!empty($page_search)) {
    //$link = add_query_arg(array('location_id'=>get_the_ID()),get_the_permalink($page_search));
    $link = add_query_arg(array('location_id' => get_the_ID(), 'pick-up' => get_the_title()), get_the_permalink($page_search));
} else {
    //$link = home_url(esc_url('?s=&post_type='.$st_type.'&location_id='.get_the_ID()));
    //$link = home_url(esc_url('?s=&post_type='.$st_type.'&location_id='.get_the_ID()."&pick-up=".get_the_title()));
    $link = add_query_arg(array('s' => '', 'post_type' => $st_type, 'location_id' => get_the_ID(), 'pick-up' => get_the_title()), home_url('/'));
}
if ($link_to == 'single') {
    $link = get_the_permalink();
}
?>
                <a class="btn btn-white btn-ghost mt10" href="<?php 
echo esc_url($link);
?>
">
                    <i class="fa fa-angle-right"></i>
                    <?php 
STLanguage::st_the_language('explore');
?>
                </a>
            </div>
        </div>
    </div>
</div>
while ($query->have_posts()) {
    $query->the_post();
    $info_room = $info_room[0];
    $price = STRental::get_price($info_room->ID);
    $price = TravelHelper::format_money($price);
    $date = date('l d M', strtotime(get_post_meta($info_room->ID, 'sale_price_from', true))) . " - " . date('l d M', strtotime(get_post_meta($info_room->ID, 'sale_price_to', true)));
    $txt = '<div class="text-center text-white">
                        <h2 class="text-uc mb20">' . STLanguage::st_get_language('last_minute_deal') . '</h2>';
    $view_star_review = st()->get_option('view_star_review', 'review');
    if ($view_star_review == 'review') {
        $txt .= ' <ul class="icon-list list-inline-block mb0 last-minute-rating">
                            ' . TravelHelper::rate_to_string(STReview::get_avg_rate()) . '
                        </ul>';
    } elseif ($view_star_review == 'star') {
        $txt .= '<ul class="icon-list list-inline-block mb0 last-minute-rating">';
        $star = STHotel::getStar();
        $txt .= TravelHelper::rate_to_string($star);
        $txt .= '</ul>';
    }
    $txt .= '<h5 class="last-minute-title">' . get_the_title() . ' - ' . $info_room->post_title . ' </h5>

                        <p class="last-minute-date">' . $date . '</p>
                        <p class="mb20">
                             <b>' . $price . '</b> / ' . STLanguage::st_get_language('night') . '
                        </p>
                        <a href="' . get_the_permalink() . '" class="btn btn-lg btn-white btn-ghost">
                           ' . STLanguage::st_get_language('book_now') . '<i class="fa fa-angle-right"></i>
                        </a>
                    </div>';
    echo balanceTags($txt);
}