echo esc_html__('Filters', 'citytours'); ?> <i class="icon-plus-1 pull-right"></i></a> <div class="collapse" id="collapseFilters"> <div class="filter_type"> <h6><?php echo esc_html__('Type', 'citytours'); ?> </h6> <ul class="list-filter post-type-filter" data-base-url="<?php echo esc_url(remove_query_arg(array('post_types', 'page'))); ?> " data-arg="post_types"> <?php if (ct_is_hotel_enabled()) { $checked = in_array('hotel', $post_type_filter) ? ' checked="checked"' : ''; echo '<li><label><input type="checkbox" name="post_types[]" value="hotel"' . $checked . '>' . esc_html__('Hotels', 'citytours') . '</label></li>'; } if (ct_is_tour_enabled()) { $checked = in_array('tour', $post_type_filter) ? ' checked="checked"' : ''; echo '<li><label><input type="checkbox" name="post_types[]" value="tour"' . $checked . '>' . esc_html__('Tours', 'citytours') . '</label></li>'; } ?> </ul> </div> </div><!--End collapse --> </div><!--End filters col--> </aside><!--End aside -->
function ct_plugin_register_meta_boxes($meta_boxes) { global $ct_options; //tour custom post type if (ct_is_tour_enabled()) { $tour_meta_boxes = ct_tour_register_meta_boxes(); $meta_boxes = array_merge($meta_boxes, $tour_meta_boxes); } if (ct_is_hotel_enabled()) { $hotel_meta_boxes = ct_hotel_register_meta_boxes(); $meta_boxes = array_merge($meta_boxes, $hotel_meta_boxes); } return $meta_boxes; }
function shortcode_hotels($atts) { extract(shortcode_atts(array('title' => '', 'type' => 'latest', 'style' => 'advanced', 'count' => 6, 'count_per_row' => 3, 'district' => '', 'post_ids' => '', 'class' => ''), $atts)); if (!ct_is_hotel_enabled()) { return ''; } $styles = array('advanced', 'simple'); $types = array('latest', 'featured', 'popular', 'hot', 'selected'); if (!in_array($style, $styles)) { $style = 'advanced'; } if (!in_array($type, $types)) { $type = 'latest'; } $post_ids = explode(',', $post_ids); $district = !empty($district) ? explode(',', $district) : array(); $count = is_numeric($count) ? $count : 6; $count_per_row = is_numeric($count_per_row) ? $count_per_row : 3; $output = ''; $hotels = array(); if ($type == 'selected') { $hotels = ct_hotel_get_hotels_from_id($post_ids); } else { $hotels = ct_hotel_get_special_hotels($type, $count, array(), $district); } if ($style == 'simple') { $output = '<div class="other_tours"><ul>'; foreach ($hotels as $post_obj) { $post_id = $post_obj->ID; $price = get_post_meta($post_id, '_hotel_price', true); $output .= '<li><a href="' . esc_url(get_permalink($post_id)) . '">' . get_the_title($post_id) . '<span class="other_tours_price">' . ct_price($price) . '</span></a></li>'; } $output .= '</ul></div>'; } else { ob_start(); global $before_list, $post_id; $before_list = ''; if (2 == $count_per_row) { $before_list = '<div class="col-md-6 col-sm-6 wow zoomIn" data-wow-delay="0.1s">'; } elseif (4 == $count_per_row) { $before_list = '<div class="col-md-3 col-sm-6 wow zoomIn" data-wow-delay="0.1s">'; } else { $before_list = '<div class="col-md-4 col-sm-6 wow zoomIn" data-wow-delay="0.1s">'; } if (!empty($title)) { echo '<h2>' . esc_html($title) . '</h2>'; } echo '<div class="hotel-list row add-clearfix' . esc_attr($class) . '">'; foreach ($hotels as $post_obj) { $post_id = $post_obj->ID; ct_get_template('loop-grid.php', '/templates/hotel/'); } echo '</div>'; $output = ob_get_contents(); ob_end_clean(); } return $output; }