예제 #1
0
				<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 -->

		<div class="col-lg-9 col-md-8">
			<div id="tools">
				<div class="row">
					<div class="col-md-6 col-sm-6 col-xs-12">
예제 #2
0
 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;
 }
예제 #3
0
 function shortcode_tours($atts)
 {
     extract(shortcode_atts(array('title' => '', 'type' => 'latest', 'style' => 'advanced', 'count' => 6, 'count_per_row' => 3, 'tour_type' => '', 'post_ids' => '', 'class' => ''), $atts));
     if (!ct_is_tour_enabled()) {
         return '';
     }
     $styles = array('advanced', 'simple', 'list');
     $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);
     $count = is_numeric($count) ? $count : 6;
     $count_per_row = is_numeric($count_per_row) ? $count_per_row : 3;
     $tour_type = !empty($tour_type) ? explode(',', $tour_type) : array();
     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">';
     }
     $tours = array();
     if ($type == 'selected') {
         $tours = ct_tour_get_tours_from_id($post_ids);
     } else {
         $tours = ct_tour_get_special_tours($type, $count, array(), $tour_type);
     }
     if ($style == 'simple') {
         $output = '<div class="other_tours"><ul>';
         foreach ($tours as $post_obj) {
             $post_id = $post_obj->ID;
             $price = get_post_meta($post_id, '_tour_price', true);
             $tour_type = wp_get_post_terms($post_id, 'tour_type');
             $output .= '<li><a href="' . esc_url(get_permalink($post_id)) . '">';
             if (!empty($tour_type)) {
                 $icon_class = get_tax_meta($tour_type[0]->term_id, 'ct_tax_icon_class', true);
                 $output .= '<i class="' . esc_attr($icon_class) . '"></i>';
             }
             $output .= get_the_title($post_id) . '<span class="other_tours_price">' . ct_price($price) . '</span></a></li>';
         }
         $output .= '</ul></div>';
     } elseif ($style == 'list') {
         ob_start();
         if (!empty($title)) {
             echo '<h2>' . esc_html($title) . '</h2>';
         }
         echo '<div class="tour-list row add-clearfix' . esc_attr($class) . '">';
         foreach ($tours as $post_obj) {
             $post_id = $post_obj->ID;
             ct_get_template('loop-list.php', '/templates/tour/');
         }
         echo '</div>';
         $output = ob_get_contents();
         ob_end_clean();
     } else {
         ob_start();
         if (!empty($title)) {
             echo '<h2>' . esc_html($title) . '</h2>';
         }
         echo '<div class="tour-list row add-clearfix' . esc_attr($class) . '">';
         foreach ($tours as $post_obj) {
             $post_id = $post_obj->ID;
             ct_get_template('loop-grid.php', '/templates/tour/');
         }
         echo '</div>';
         $output = ob_get_contents();
         ob_end_clean();
     }
     return $output;
 }