PluginProbe
WP Directory Kit / 1.2.9
WP Directory Kit v1.2.9
1.5.9 1.5.7 1.5.6 1.5.5 1.5.4 1.5.3 trunk 1.1.0 1.1.6 1.1.8 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.8 All 37 releases
wpdirectorykit / elementor-elements / views / wdk-listings-results.php

wdk-listings-results.php in WP Directory Kit 1.2.9, at elementor-elements/views/wdk-listings-results.php

189 lines 11.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * The template for Element Listings Results.
4 * This is the template that elementor element listings, list, grid
5 *
6 */
7
8 if ( ! defined( 'ABSPATH' ) ) {
9 exit; // Exit if accessed directly.
10 }
11
12
13 ?>
14 <div class="wdk-element" id="wdk_el_<?php echo esc_html($id_element);?>">
15 <div class="wdk-listings-results
16 <?php echo wmvc_show_data('styles_thmbn_des_type',$settings, '');?> view-<?php echo wmvc_show_data('layout_type',$settings, '');?>
17 <?php if(wmvc_show_data('enable_separed_styles',$settings, '') == true):?> enable_separed_styles <?php endif;?>
18 "
19 <?php if($settings['get_filters_enable'] == 'yes'):?> id="results" <?php endif;?>>
20 <?php if($settings['get_filters_enable'] == 'yes'
21 && !(
22 $settings['sorting_enable'] != 'yes' &&
23 $settings['view_type_enable'] != 'yes' &&
24 $settings['show_numbers_results_enable'] != 'yes'
25 )):?>
26 <div class="wdk-filter-head">
27 <?php if($settings['sorting_enable'] == 'yes'):?>
28 <div class="filter-group order">
29 <?php \Elementor\Icons_Manager::render_icon( $settings['filter_group_box_icon'], [ 'aria-hidden' => 'true' ] );?>
30 <select name="order_by" class='wdk-order'>
31 <?php if(!empty($custom_order)):?>
32 <?php foreach ($custom_order as $item):?>
33 <option value="<?php echo wmvc_show_data('key', $item);?>" <?php echo (wmvc_show_data('order_by', $_GET, '') == wmvc_show_data('key', $item))?'selected="selected"':''; ?>><?php echo esc_html__(wmvc_show_data('title', $item), 'wpdirectorykit');?></option>
34 <?php endforeach;?>
35 <?php else:?>
36 <option value="post_id DESC" <?php echo !empty(wmvc_show_data('order_by', $_GET, '') =='post_id DESC')?'selected="selected"':''; ?>><?php echo esc_html__('Sort by: Latest', 'wpdirectorykit');?></option>
37 <option value="post_id ASC" <?php echo (wmvc_show_data('order_by', $_GET, '') =='post_id ASC')?'selected="selected"':''; ?>><?php echo esc_html__('Sort by: Oldest', 'wpdirectorykit');?></option>
38 <option value="post_title ASC" <?php echo !empty(wmvc_show_data('order_by', $_GET, '') =='post_title ASC')?'selected="selected"':''; ?>><?php echo esc_html__('Sort by: Title Asc', 'wpdirectorykit');?></option>
39 <option value="post_title DESC" <?php echo !empty(wmvc_show_data('order_by', $_GET, '') =='post_title DESC')?'selected="selected"':''; ?>><?php echo esc_html__('Sort by: Title Desc', 'wpdirectorykit');?></option>
40 <?php endif;?>
41 </select>
42 </div>
43 <?php endif;?>
44 <?php if($settings['view_type_enable'] == 'yes'):?>
45 <div class="filter-group wmvc-view-type">
46 <a class="nav-link <?php echo (wmvc_show_data('layout_type', $settings, '') =='list')?'active':''; ?>" data-id="list" href="#list-view"><i class="fa fa-list-ul"></i></a>
47 <a class="nav-link <?php echo (wmvc_show_data('layout_type', $settings, '') =='grid')?'active':''; ?>" data-id="grid" href="#grid-view"><i class="fa fa-th"></i></a>
48 </div>
49 <?php endif;?>
50 <?php if($settings['show_numbers_results_enable'] == 'yes'):?>
51 <div class="filter-group filter-status">
52 <span><?php echo esc_html($listings_count);?> <?php echo esc_html__('Listings', 'wpdirectorykit');?></span>
53 </div>
54 <?php endif;?>
55 </div>
56 <?php endif;?>
57 <?php if(!empty($results)):?>
58 <?php if($settings['layout_type'] == 'carousel'):?>
59 <div class="wdk_results_listings_slider_box <?php echo esc_attr($settings['layout_carousel_animation_style']).'_animation';?> <?php echo join(' ', [$settings['styles_carousel_dots_position_style'], $settings['styles_carousel_arrows_position']]);?>">
60 <div class="wdk_results_listings_slider_body">
61 <div class="wdk_results_listings_slider_ini">
62 <?php else:?>
63 <div class="wdk-row <?php if(isset($settings['is_mobile_view_enable']) && $settings['is_mobile_view_enable'] == 'yes'):?> WdkScrollMobileSwipe_enable <?php endif;?>">
64 <?php endif;?>
65 <?php foreach($results as $listing):?>
66 <div class="wdk-col">
67 <?php if($settings['is_custom_layout_enable'] == 'yes'):?>
68 <?php
69 $content = '';
70 if(!empty($settings['custom_layout_id'])){
71 $post_data = get_post($settings['custom_layout_id']);
72
73 global $wdk_listing_id;
74 $wdk_listing_id = wmvc_show_data('post_id', $listing);
75 if($post_data){
76 if($post_data->post_type == 'page' || $post_data->post_type == 'elementor_library') {
77 $elementor_instance = \Elementor\Plugin::instance();
78 $content = $elementor_instance->frontend->get_builder_content_for_display($settings['custom_layout_id']);
79 if(empty($content ))
80 $content = $post_data->post_content;
81 } else {
82 $content = $post_data->post_content;
83 }
84 }
85 }
86 ?>
87 <?php echo wp_kses_post($content);?>
88 <?php else:?>
89 <?php echo wdk_listing_card($listing, $settings);?>
90 <?php endif;?>
91 </div>
92 <?php endforeach;?>
93 <?php if($settings['layout_type'] == 'carousel'):?>
94 </div>
95 <div class="wdk_slider_arrows">
96 <a class="wdk-slider-prev wdk_lr_slider_arrow">
97 <?php \Elementor\Icons_Manager::render_icon( $settings['styles_carousel_arrows_icon_left'], [ 'aria-hidden' => 'true' ] ); ?>
98 </a>
99 <a class="wdk-slider-next wdk_lr_slider_arrow">
100 <?php \Elementor\Icons_Manager::render_icon( $settings['styles_carousel_arrows_icon_right'], [ 'aria-hidden' => 'true' ] ); ?>
101 </a>
102 </div>
103 </div>
104 </div>
105 <?php else:?>
106 </div>
107 <?php endif;?>
108 <?php else:?>
109 <p class="wdk_alert wdk_alert-danger"><?php echo esc_html__('Results not found', 'wpdirectorykit');?></p>
110 <?php endif;?>
111 <?php if($settings['layout_type'] != 'carousel'):?>
112 <?php echo wmvc_xss_clean($pagination_output); ?>
113 <?php endif;?>
114 </div>
115 <?php if($settings['layout_type'] == 'carousel'):?>
116 <script>
117 jQuery(document).ready(function($){
118 var el = $('#wdk_el_<?php echo esc_html($id_element);?> .wdk_results_listings_slider_ini').slick({
119 dots: true,
120 arrows: true,
121 slidesToShow: <?php echo (!empty(trim(wmvc_show_data('layout_carousel_columns', $settings, '3')))) ? wmvc_show_data('layout_carousel_columns', $settings, '3') : 3;?>,
122 slidesToScroll: <?php echo (!empty(trim(wmvc_show_data('layout_carousel_columns', $settings, '3')))) ? wmvc_show_data('layout_carousel_columns', $settings, '3') : 3;?>,
123 <?php if(!empty(wmvc_show_data('layout_carousel_is_infinite', $settings))):?>
124 infinite: <?php echo wmvc_show_data('layout_carousel_is_infinite', $settings, 'true');?>,
125 <?php endif;?>
126 <?php if(!empty(wmvc_show_data('layout_carousel_is_autoplay', $settings))):?>
127 autoplay: <?php echo wmvc_show_data('layout_carousel_is_autoplay', $settings, 'false');?>,
128 <?php endif;?>
129 nextArrow: $('#wdk_el_<?php echo esc_html($id_element);?> .wdk_slider_arrows .wdk-slider-next'),
130 prevArrow: $('#wdk_el_<?php echo esc_html($id_element);?> .wdk_slider_arrows .wdk-slider-prev'),
131 customPaging: function(slider, i) {
132 // this example would render "tabs" with titles
133 return '<span class="wdk_lr_dot"><?php \Elementor\Icons_Manager::render_icon( $settings['styles_carousel_dots_icon'], [ 'aria-hidden' => 'true' ] ); ?></span>';
134 },
135 responsive: [
136 {
137 breakpoint: 991,
138 settings: {
139 slidesToShow: <?php echo (!empty(trim(wmvc_show_data('layout_carousel_columns_tablet', $settings, '2')))) ? wmvc_show_data('layout_carousel_columns_tablet', $settings, '2') : 2;?>,
140 slidesToScroll: <?php echo (!empty(trim(wmvc_show_data('layout_carousel_columns_tablet', $settings, '2')))) ? wmvc_show_data('layout_carousel_columns_tablet', $settings, '2') : 2;?>,
141 }
142 },
143 {
144 breakpoint: 768,
145 settings: {
146 slidesToShow: <?php echo (!empty(trim(wmvc_show_data('layout_carousel_columns_mobile', $settings, '1')))) ? wmvc_show_data('layout_carousel_columns_mobile', $settings, '1') : 1;?>,
147 slidesToScroll: <?php echo (!empty(trim(wmvc_show_data('layout_carousel_columns_mobile', $settings, '1')))) ? wmvc_show_data('layout_carousel_columns_mobile', $settings, '1') : 1;?>,
148 }
149 },
150 ]
151 }).on('breakpoint', function(event, slick, breakpoint){
152 wdk_result_listings_thumbnail_slider(el);
153
154 if (typeof wdk_favorite == 'function') {
155 wdk_favorite('.wdk_results_listings_slider_ini');
156 }
157
158 if (typeof wdk_init_compare_elem == 'function') {
159 wdk_init_compare_elem();
160 }
161
162 });
163
164 wdk_slick_slider_init(el, ()=>{
165 wdk_result_listings_thumbnail_slider(el);
166
167 if (typeof wdk_favorite == 'function') {
168 wdk_favorite('.wdk_results_listings_slider_ini');
169 }
170
171 if (typeof wdk_init_compare_elem == 'function') {
172 wdk_init_compare_elem();
173 }
174 });
175 })
176 </script>
177 <?php endif;?>
178 <?php if($is_edit_mode):?>
179 <script>
180 jQuery(document).ready(function($){
181 if(typeof wdk_result_listings_thumbnail_slider == 'function') {
182 wdk_result_listings_thumbnail_slider();
183 }
184 })
185 </script>
186 <?php endif;?>
187 </div>
188
189