PluginProbe
WP Directory Kit / 1.5.9
WP Directory Kit v1.5.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-carousel.php

wdk-listings-carousel.php in WP Directory Kit 1.5.9, at elementor-elements/views/wdk-listings-carousel.php

119 lines 6.5 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 Carousel.
4 * This is the template that elementor element carousel
5 *
6 */
7
8 if ( ! defined( 'ABSPATH' ) ) {
9 exit; // Exit if accessed directly.
10 }
11
12 ?>
13 <div class="wdk-element" id="wdk_el_<?php echo esc_html($id_element);?>">
14 <div class="wdk-listings-results wdk-listings-carousel <?php echo esc_attr(wmvc_show_data('styles_thmbn_des_type',$settings, ''));?>">
15 <?php if(count($results) > 0):?>
16 <?php if(!empty($results) && wmvc_show_data('layout_carousel_columns', $settings,1) < wmvc_count($results)):?>
17 <div class="wdk_results_listings_slider_box <?php echo esc_attr($settings['layout_carousel_animation_style']).'_animation';?> <?php echo esc_attr(join(' ', [$settings['styles_carousel_dots_position_style'],$settings['styles_carousel_arrows_position']]));?>">
18 <div class="wdk_results_listings_slider_body">
19 <div class="wdk_results_listings_slider_ini">
20 <?php else:?>
21 <div class="wdk-row">
22 <?php endif;?>
23 <?php foreach($results as $listing):?>
24 <div class="wdk-col">
25 <?php
26 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped, WordPress.WP.I18n.NonSingularStringLiteralText
27 echo wdk_listing_card($listing, $settings);?>
28 </div>
29 <?php endforeach;?>
30
31 <?php if(!empty($results) && wmvc_show_data('layout_carousel_columns', $settings,1) < wmvc_count($results)):?>
32 </div>
33 <div class="wdk_slider_arrows">
34 <a title="<?php echo esc_attr__('prev slider', 'wpdirectorykit');?>" href="#" class="wdk-slider-prev wdk_lr_slider_arrow">
35 <?php \Elementor\Icons_Manager::render_icon( $settings['styles_carousel_arrows_icon_left'], [ 'aria-hidden' => 'true' ] ); ?>
36 </a>
37 <a title="<?php echo esc_attr__('next slider', 'wpdirectorykit');?>" href="#" class="wdk-slider-next wdk_lr_slider_arrow">
38 <?php \Elementor\Icons_Manager::render_icon( $settings['styles_carousel_arrows_icon_right'], [ 'aria-hidden' => 'true' ] ); ?>
39 </a>
40 </div>
41 </div>
42 </div>
43 <?php else:?>
44 </div>
45 <?php endif;?>
46 <?php else:?>
47 <p class="wdk_alert wdk_alert-danger"><?php echo esc_html__('Results not found', 'wpdirectorykit');?></p>
48 <?php endif;?>
49 </div>
50 <script>
51 jQuery(document).ready(function($){
52 var el = $('#wdk_el_<?php echo esc_html($id_element);?> .wdk_results_listings_slider_ini').slick({
53 margin: 0,
54 centerPadding: '0',
55 <?php if(!empty($results) && wmvc_show_data('layout_carousel_columns', $settings,1) < wmvc_count($results)):?>
56 dots: true,
57 arrows: true,
58 <?php else:?>
59 dots: false,
60 arrows: false,
61 <?php endif;?>
62 slidesToShow: <?php echo esc_js(wmvc_show_data('layout_carousel_columns', $settings, 1));?>,
63 slidesToScroll: <?php echo esc_js(wmvc_show_data('layout_carousel_columns', $settings,1));?>,
64 <?php if(!empty(wmvc_show_data('layout_carousel_is_infinite', $settings))):?>
65 infinite: <?php echo esc_js(wmvc_show_data('layout_carousel_is_infinite', $settings, 'true'));?>,
66 <?php endif;?>
67 <?php if(!empty(wmvc_show_data('layout_carousel_is_autoplay', $settings))):?>
68 autoplay: <?php echo esc_js(wmvc_show_data('layout_carousel_is_autoplay', $settings, 'false'));?>,
69 <?php endif;?>
70 nextArrow: $('#wdk_el_<?php echo esc_html($id_element);?> .wdk_slider_arrows .wdk-slider-next'),
71 prevArrow: $('#wdk_el_<?php echo esc_html($id_element);?> .wdk_slider_arrows .wdk-slider-prev'),
72 customPaging: function(slider, i) {
73 // this example would render "tabs" with titles
74 return '<span class="wdk_lr_dot"><?php \Elementor\Icons_Manager::render_icon( $settings['styles_carousel_dots_icon'], [ 'aria-hidden' => 'true' ] ); ?></span>';
75 },
76 responsive: [
77 {
78 breakpoint: 991,
79 settings: {
80 slidesToShow: <?php echo (!empty(trim(wmvc_show_data('layout_carousel_columns_tablet', $settings, '2')))) ? esc_js(wmvc_show_data('layout_carousel_columns_tablet', $settings, '2')) : 2;?>,
81 slidesToScroll: <?php echo (!empty(trim(wmvc_show_data('layout_carousel_columns_tablet', $settings, '2')))) ? esc_js(wmvc_show_data('layout_carousel_columns_tablet', $settings, '2')) : 2;?>,
82 }
83 },
84 {
85 breakpoint: 768,
86 settings: {
87 slidesToShow: <?php echo (!empty(trim(wmvc_show_data('layout_carousel_columns_mobile', $settings, '1')))) ? esc_js(wmvc_show_data('layout_carousel_columns_mobile', $settings, '1')) : 1;?>,
88 slidesToScroll: <?php echo (!empty(trim(wmvc_show_data('layout_carousel_columns_mobile', $settings, '1')))) ? esc_js(wmvc_show_data('layout_carousel_columns_mobile', $settings, '1')) : 1;?>,
89 }
90 },
91 ]
92 }).on('breakpoint', function(event, slick, breakpoint){
93 wdk_result_listings_thumbnail_slider(el);
94
95 if (typeof wdk_favorite == 'function') {
96 wdk_favorite('.wdk_results_listings_slider_ini');
97 }
98
99 if (typeof wdk_init_compare_elem == 'function') {
100 wdk_init_compare_elem();
101 }
102 });
103
104 wdk_slick_slider_init(el, ()=>{
105 wdk_result_listings_thumbnail_slider(el);
106
107 if (typeof wdk_favorite == 'function') {
108 wdk_favorite('.wdk_results_listings_slider_ini');
109 }
110
111 if (typeof wdk_init_compare_elem == 'function') {
112 wdk_init_compare_elem();
113 }
114 });
115 })
116 </script>
117 </div>
118
119