PluginProbe
WP Directory Kit / 1.2.7
WP Directory Kit v1.2.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 1.4.0 1.4.1 All 35 releases
wpdirectorykit / elementor-elements / views / wdk-listings-results.php

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

162 lines 9.6 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 <?php echo wmvc_show_data('styles_thmbn_des_type',$settings, '');?> view-<?php echo wmvc_show_data('layout_type',$settings, '');?>" <?php if($settings['get_filters_enable'] == 'yes'):?> id="results" <?php endif;?>>
16 <?php if($settings['get_filters_enable'] == 'yes'
17 && !(
18 $settings['sorting_enable'] != 'yes' &&
19 $settings['view_type_enable'] != 'yes' &&
20 $settings['show_numbers_results_enable'] != 'yes'
21 )):?>
22 <div class="wdk-filter-head">
23 <?php if($settings['sorting_enable'] == 'yes'):?>
24 <div class="filter-group order">
25 <?php \Elementor\Icons_Manager::render_icon( $settings['filter_group_box_icon'], [ 'aria-hidden' => 'true' ] );?>
26 <select name="order_by" class='wdk-order'>
27 <?php if(!empty($custom_order)):?>
28 <?php foreach ($custom_order as $item):?>
29 <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>
30 <?php endforeach;?>
31 <?php else:?>
32 <option value="post_id ASC" <?php echo (wmvc_show_data('order_by', $_GET, '') =='post_id ASC')?'selected="selected"':''; ?>><?php echo esc_html__('Sort by: Newest', 'wpdirectorykit');?></option>
33 <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>
34 <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>
35 <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>
36 <?php endif;?>
37 </select>
38 </div>
39 <?php endif;?>
40 <?php if($settings['view_type_enable'] == 'yes'):?>
41 <div class="filter-group wmvc-view-type">
42 <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>
43 <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>
44 </div>
45 <?php endif;?>
46 <?php if($settings['show_numbers_results_enable'] == 'yes'):?>
47 <div class="filter-group filter-status">
48 <span><?php echo esc_html($listings_count);?> <?php echo esc_html__('Listings', 'wpdirectorykit');?></span>
49 </div>
50 <?php endif;?>
51 </div>
52 <?php endif;?>
53 <?php if(!empty($results)):?>
54 <?php if($settings['layout_type'] == 'carousel'):?>
55 <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']]);?>">
56 <div class="wdk_results_listings_slider_body">
57 <div class="wdk_results_listings_slider_ini">
58 <?php else:?>
59 <div class="wdk-row <?php if(isset($settings['is_mobile_view_enable']) && $settings['is_mobile_view_enable'] == 'yes'):?> WdkScrollMobileSwipe_enable <?php endif;?>">
60 <?php endif;?>
61 <?php foreach($results as $listing):?>
62 <div class="wdk-col">
63 <?php echo wdk_listing_card($listing, $settings);?>
64 </div>
65 <?php endforeach;?>
66 <?php if($settings['layout_type'] == 'carousel'):?>
67 </div>
68 <div class="wdk_slider_arrows">
69 <a class="wdk-slider-prev wdk_lr_slider_arrow">
70 <?php \Elementor\Icons_Manager::render_icon( $settings['styles_carousel_arrows_icon_left'], [ 'aria-hidden' => 'true' ] ); ?>
71 </a>
72 <a class="wdk-slider-next wdk_lr_slider_arrow">
73 <?php \Elementor\Icons_Manager::render_icon( $settings['styles_carousel_arrows_icon_right'], [ 'aria-hidden' => 'true' ] ); ?>
74 </a>
75 </div>
76 </div>
77 </div>
78 <?php else:?>
79 </div>
80 <?php endif;?>
81 <?php else:?>
82 <p class="wdk_alert wdk_alert-danger"><?php echo esc_html__('Results not found', 'wpdirectorykit');?></p>
83 <?php endif;?>
84 <?php if($settings['layout_type'] != 'carousel'):?>
85 <?php echo wmvc_xss_clean($pagination_output); ?>
86 <?php endif;?>
87 </div>
88 <?php if($settings['layout_type'] == 'carousel'):?>
89 <script>
90 jQuery(document).ready(function($){
91 var el = $('#wdk_el_<?php echo esc_html($id_element);?> .wdk_results_listings_slider_ini').slick({
92 dots: true,
93 arrows: true,
94 slidesToShow: <?php echo (!empty(trim(wmvc_show_data('layout_carousel_columns', $settings, '3')))) ? wmvc_show_data('layout_carousel_columns', $settings, '3') : 3;?>,
95 slidesToScroll: <?php echo (!empty(trim(wmvc_show_data('layout_carousel_columns', $settings, '3')))) ? wmvc_show_data('layout_carousel_columns', $settings, '3') : 3;?>,
96 <?php if(!empty(wmvc_show_data('layout_carousel_is_infinite', $settings))):?>
97 infinite: <?php echo wmvc_show_data('layout_carousel_is_infinite', $settings, 'true');?>,
98 <?php endif;?>
99 <?php if(!empty(wmvc_show_data('layout_carousel_is_autoplay', $settings))):?>
100 autoplay: <?php echo wmvc_show_data('layout_carousel_is_autoplay', $settings, 'false');?>,
101 <?php endif;?>
102 nextArrow: $('#wdk_el_<?php echo esc_html($id_element);?> .wdk_slider_arrows .wdk-slider-next'),
103 prevArrow: $('#wdk_el_<?php echo esc_html($id_element);?> .wdk_slider_arrows .wdk-slider-prev'),
104 customPaging: function(slider, i) {
105 // this example would render "tabs" with titles
106 return '<span class="wdk_lr_dot"><?php \Elementor\Icons_Manager::render_icon( $settings['styles_carousel_dots_icon'], [ 'aria-hidden' => 'true' ] ); ?></span>';
107 },
108 responsive: [
109 {
110 breakpoint: 991,
111 settings: {
112 slidesToShow: <?php echo (!empty(trim(wmvc_show_data('layout_carousel_columns_tablet', $settings, '2')))) ? wmvc_show_data('layout_carousel_columns_tablet', $settings, '2') : 2;?>,
113 slidesToScroll: <?php echo (!empty(trim(wmvc_show_data('layout_carousel_columns_tablet', $settings, '2')))) ? wmvc_show_data('layout_carousel_columns_tablet', $settings, '2') : 2;?>,
114 }
115 },
116 {
117 breakpoint: 768,
118 settings: {
119 slidesToShow: <?php echo (!empty(trim(wmvc_show_data('layout_carousel_columns_mobile', $settings, '1')))) ? wmvc_show_data('layout_carousel_columns_mobile', $settings, '1') : 1;?>,
120 slidesToScroll: <?php echo (!empty(trim(wmvc_show_data('layout_carousel_columns_mobile', $settings, '1')))) ? wmvc_show_data('layout_carousel_columns_mobile', $settings, '1') : 1;?>,
121 }
122 },
123 ]
124 }).on('breakpoint', function(event, slick, breakpoint){
125 wdk_result_listings_thumbnail_slider(el);
126
127 if (typeof wdk_favorite == 'function') {
128 wdk_favorite('.wdk_results_listings_slider_ini');
129 }
130
131 if (typeof wdk_init_compare_elem == 'function') {
132 wdk_init_compare_elem();
133 }
134
135 });
136
137 wdk_slick_slider_init(el, ()=>{
138 wdk_result_listings_thumbnail_slider(el);
139
140 if (typeof wdk_favorite == 'function') {
141 wdk_favorite('.wdk_results_listings_slider_ini');
142 }
143
144 if (typeof wdk_init_compare_elem == 'function') {
145 wdk_init_compare_elem();
146 }
147 });
148 })
149 </script>
150 <?php endif;?>
151 <?php if($is_edit_mode):?>
152 <script>
153 jQuery(document).ready(function($){
154 if(typeof wdk_result_listings_thumbnail_slider == 'function') {
155 wdk_result_listings_thumbnail_slider();
156 }
157 })
158 </script>
159 <?php endif;?>
160 </div>
161
162