PluginProbe
WP Directory Kit / 1.5.3
WP Directory Kit v1.5.3
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.5.3, at elementor-elements/views/wdk-listings-results.php

257 lines 15.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 <?php if
19 (
20 wdk_get_option('wdk_experimental_features') && wdk_get_option('wdk_experimental_ajax_results') &&
21 isset($settings['is_ajax_enable']) && $settings['is_ajax_enable'] == 'yes'
22 ):?>
23 ajax_results_enabled
24 <?php endif;?>
25 "
26 data-el_id="<?php echo esc_attr($this->get_id());?>"
27 data-el_type="<?php echo esc_attr($this->get_name());?>"
28 <?php
29 $post_id = get_the_ID();
30 $post_object_id = get_queried_object_id();
31 if($post_object_id)
32 $post_id = $post_object_id;
33
34 global $wdk_listing_page_id;
35 if(!empty($wdk_listing_page_id))
36 $post_id = $wdk_listing_page_id;
37 ?>
38 data-el_page_id="<?php echo esc_attr($post_id);?>"
39
40 <?php if($settings['get_filters_enable'] == 'yes'):?> id="results" <?php endif;?>>
41 <?php if($settings['get_filters_enable'] == 'yes'
42 && !(
43 $settings['sorting_enable'] != 'yes' &&
44 $settings['view_type_enable'] != 'yes' &&
45 $settings['show_numbers_results_enable'] != 'yes'
46 )):?>
47 <div class="wdk-filter-head">
48 <?php if($settings['sorting_enable'] == 'yes'):?>
49 <div class="filter-group order">
50 <?php \Elementor\Icons_Manager::render_icon( $settings['filter_group_box_icon'], [ 'aria-hidden' => 'true' ] );?>
51 <select name="order_by" class='wdk-order'>
52 <?php if(!empty($custom_order)):?>
53 <?php foreach ($custom_order as $item):?>
54 <?php
55 if (strpos($item['key'], '__') !== FALSE) {
56 $item['key'] = substr($item['key'], strpos($item['key'], '__') + 2);
57 }
58 if(!empty($item['order_type'])) {
59 $item['key'] .= ' '.$item['order_type'];
60 }
61 ?>
62 <option value="<?php echo esc_attr($item['key']);?>" <?php echo (wmvc_show_data('order_by', $_GET, '') == $item['key'])?'selected="selected"':''; ?>><?php echo esc_html__(wmvc_show_data('title', $item), 'wpdirectorykit');?></option>
63 <?php endforeach;?>
64 <?php else:?>
65 <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>
66 <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>
67 <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>
68 <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>
69 <?php endif;?>
70 </select>
71 </div>
72 <?php endif;?>
73 <?php if($settings['view_type_enable'] == 'yes'):?>
74 <div class="filter-group wmvc-view-type">
75 <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>
76 <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>
77 </div>
78 <?php endif;?>
79 <?php if($settings['show_numbers_results_enable'] == 'yes'):?>
80 <div class="filter-group filter-status">
81 <span><?php echo esc_html($listings_count);?> <?php echo esc_html__('Listings', 'wpdirectorykit');?></span>
82 </div>
83 <?php endif;?>
84 </div>
85 <?php endif;?>
86 <?php if(!empty($results)):?>
87 <?php if($settings['layout_type'] == 'carousel'):?>
88 <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']]);?>">
89 <div class="wdk_results_listings_slider_body">
90 <div class="wdk_results_listings_slider_ini">
91 <?php else:?>
92 <div class="wdk-row wdk-inner-listings-results <?php if(isset($settings['is_mobile_view_enable']) && $settings['is_mobile_view_enable'] == 'yes'):?> WdkScrollMobileSwipe_enable <?php endif;?>">
93 <?php endif;?>
94 <?php foreach($results as $listing):?>
95 <div class="wdk-col">
96 <div class="wdk-card--wrapper <?php if(isset($settings['is_complete_link']) && $settings['is_complete_link'] == 'yes'):?> hover_link elementor-clickable <?php endif;?>" <?php if(isset($settings['is_complete_link']) && $settings['is_complete_link'] == 'yes'):?> onclick="location.href='<?php echo esc_url( get_permalink($listing) ); ?>'" <?php endif;?>>
97 <?php if
98 (
99 wdk_get_option('wdk_experimental_features') && wdk_get_option('wdk_experimental_listing_card_elementor_layout') &&
100 isset($settings['is_custom_layout_enable']) && $settings['is_custom_layout_enable'] == 'yes'
101 && isset($settings['custom_layout_id_list']) && isset($settings['custom_layout_id_grid'])
102 ):?>
103 <?php if($settings['layout_type'] == 'list' && (!empty($settings['custom_layout_id_list']) || !empty($settings['custom_layout_live_list']))):?>
104 <?php
105 $content = '';
106 global $wdk_listing_id;
107 $wdk_listing_id = wmvc_show_data('post_id', $listing);
108 $content = wdk_render_elementor_template( empty( $settings['custom_layout_id_list'] ) ? $settings['custom_layout_live_list'] : $settings['custom_layout_id_list'], true);
109 ?>
110 <?php if(true || !$is_edit_mode):?>
111 <?php
112 $allowed_tags = array_merge(
113 wp_kses_allowed_html('post'),
114 array('style' => array())
115 );
116 echo wp_kses($content, $allowed_tags);
117 ?>
118 <?php else:?>
119 <?php echo esc_html__( 'Listings Card Grid From Extern Layout', 'wpdirectorykit' );?>
120 <?php endif;?>
121 <?php elseif(($settings['layout_type'] == 'grid' || $settings['layout_type'] == 'carousel') && (!empty($settings['custom_layout_id_grid']) || !empty($settings['custom_layout_live_grid']))):?>
122 <?php
123 $content = '';
124 global $wdk_listing_id;
125 $wdk_listing_id = wmvc_show_data('post_id', $listing);
126 $content = wdk_render_elementor_template( empty( $settings['custom_layout_id_grid'] ) ? $settings['custom_layout_live_grid'] : $settings['custom_layout_id_grid'], true);
127 ?>
128 <?php if(true || !$is_edit_mode):?>
129 <?php
130 $allowed_tags = array_merge(
131 wp_kses_allowed_html('post'),
132 array('style' => array())
133 );
134 echo wp_kses($content, $allowed_tags);
135 ?>
136 <?php else:?>
137 <?php echo esc_html__( 'Listings Card List From Extern Layout', 'wpdirectorykit' );?>
138 <?php endif;?>
139 <?php else:?>
140 <?php echo wdk_listing_card($listing, $settings);?>
141 <?php endif;?>
142 <?php else:?>
143 <?php echo wdk_listing_card($listing, $settings);?>
144 <?php endif;?>
145 </div>
146 </div>
147 <?php endforeach;?>
148 <?php if($settings['layout_type'] == 'carousel'):?>
149 </div>
150 <div class="wdk_slider_arrows">
151 <a title="<?php echo esc_attr__('prev slider', 'wpdirectorykit');?>" href="#" class="wdk-slider-prev wdk_lr_slider_arrow">
152 <?php \Elementor\Icons_Manager::render_icon( $settings['styles_carousel_arrows_icon_left'], [ 'aria-hidden' => 'true' ] ); ?>
153 </a>
154 <a title="<?php echo esc_attr__('next slider', 'wpdirectorykit');?>" href="#" class="wdk-slider-next wdk_lr_slider_arrow">
155 <?php \Elementor\Icons_Manager::render_icon( $settings['styles_carousel_arrows_icon_right'], [ 'aria-hidden' => 'true' ] ); ?>
156 </a>
157 </div>
158 </div>
159 </div>
160 <?php else:?>
161 </div>
162 <?php endif;?>
163 <?php else:?>
164 <p class="wdk_alert wdk_alert-danger"><?php echo esc_html__('Results not found', 'wpdirectorykit');?></p>
165 <?php endif;?>
166 <?php if($settings['layout_type'] != 'carousel'):?>
167 <?php echo wmvc_xss_clean($pagination_output); ?>
168 <?php endif;?>
169 </div>
170 <?php if($settings['layout_type'] == 'carousel'):?>
171 <script>
172 jQuery(document).ready(function($){
173 var el = $('#wdk_el_<?php echo esc_html($id_element);?> .wdk_results_listings_slider_ini').slick({
174 dots: true,
175 arrows: true,
176 rtl: localStorage.getItem('siteDirection') == "rtl" ? true : false,
177 <?php if(!empty(wmvc_show_data('layout_carousel_is_centerMode', $settings))):?>
178 centerMode: <?php echo wmvc_show_data('layout_carousel_is_centerMode', $settings, 'true');?>,
179 <?php endif;?>
180 slidesToShow: <?php echo (!empty(trim(wmvc_show_data('layout_carousel_columns', $settings, '3')))) ? wmvc_show_data('layout_carousel_columns', $settings, '3') : 3;?>,
181 slidesToScroll: <?php echo (!empty(trim(wmvc_show_data('layout_carousel_columns', $settings, '3')))) ? wmvc_show_data('layout_carousel_columns', $settings, '3') : 3;?>,
182 <?php if(!empty(wmvc_show_data('layout_carousel_is_infinite', $settings))):?>
183 infinite: <?php echo wmvc_show_data('layout_carousel_is_infinite', $settings, 'true');?>,
184 <?php endif;?>
185 <?php if(!empty(wmvc_show_data('layout_carousel_is_autoplay', $settings))):?>
186 autoplay: <?php echo wmvc_show_data('layout_carousel_is_autoplay', $settings, 'false');?>,
187 <?php endif;?>
188 nextArrow: $('#wdk_el_<?php echo esc_html($id_element);?> .wdk_slider_arrows .wdk-slider-next'),
189 prevArrow: $('#wdk_el_<?php echo esc_html($id_element);?> .wdk_slider_arrows .wdk-slider-prev'),
190 customPaging: function(slider, i) {
191 // this example would render "tabs" with titles
192 return '<span class="wdk_lr_dot"><?php \Elementor\Icons_Manager::render_icon( $settings['styles_carousel_dots_icon'], [ 'aria-hidden' => 'true' ] ); ?></span>';
193 },
194 responsive: [
195 {
196 breakpoint: 991,
197 settings: {
198 slidesToShow: <?php echo (!empty(trim(wmvc_show_data('layout_carousel_columns_tablet', $settings, '2')))) ? wmvc_show_data('layout_carousel_columns_tablet', $settings, '2') : 2;?>,
199 slidesToScroll: <?php echo (!empty(trim(wmvc_show_data('layout_carousel_columns_tablet', $settings, '2')))) ? wmvc_show_data('layout_carousel_columns_tablet', $settings, '2') : 2;?>,
200 }
201 },
202 {
203 breakpoint: 768,
204 settings: {
205 slidesToShow: <?php echo (!empty(trim(wmvc_show_data('layout_carousel_columns_mobile', $settings, '1')))) ? wmvc_show_data('layout_carousel_columns_mobile', $settings, '1') : 1;?>,
206 slidesToScroll: <?php echo (!empty(trim(wmvc_show_data('layout_carousel_columns_mobile', $settings, '1')))) ? wmvc_show_data('layout_carousel_columns_mobile', $settings, '1') : 1;?>,
207 }
208 },
209 ]
210 }).on('breakpoint', function(event, slick, breakpoint){
211 wdk_result_listings_thumbnail_slider(el);
212
213 if (typeof wdk_favorite == 'function') {
214 wdk_favorite('.wdk_results_listings_slider_ini');
215 }
216
217 if (typeof wdk_init_compare_elem == 'function') {
218 wdk_init_compare_elem();
219 }
220
221 if (typeof wdk_popup_listings == 'function') {
222 wdk_popup_listings();
223 }
224
225 });
226
227 wdk_slick_slider_init(el, ()=>{
228 wdk_result_listings_thumbnail_slider(el);
229
230 if (typeof wdk_favorite == 'function') {
231 wdk_favorite('.wdk_results_listings_slider_ini');
232 }
233
234 if (typeof wdk_init_compare_elem == 'function') {
235 wdk_init_compare_elem();
236 }
237
238
239 if (typeof wdk_popup_listings == 'function') {
240 wdk_popup_listings();
241 }
242 });
243 })
244 </script>
245 <?php endif;?>
246 <?php if($is_edit_mode):?>
247 <script>
248 jQuery(document).ready(function($){
249 if(typeof wdk_result_listings_thumbnail_slider == 'function') {
250 wdk_result_listings_thumbnail_slider();
251 }
252 })
253 </script>
254 <?php endif;?>
255 </div>
256
257