PluginProbe
WP Directory Kit / 1.2.3
WP Directory Kit v1.2.3
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-listing-carousel.php

wdk-listing-carousel.php in WP Directory Kit 1.2.3, at elementor-elements/views/wdk-listing-carousel.php

109 lines 5.9 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 Listing Images Slider.
4 * This is the template that elementor element slider, 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-listing-carousel wdk_js_gallery">
15 <?php if(count($images) > 0):?>
16 <div class=" <?php if(count($images) == 1):?> full_width <?php endif;?> wdk_listing_slider_box wdk-listing-carousel_arrows_in <?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'],$settings['direction']]));?>">
17 <div class="wdk_listing_slider_ini">
18 <?php foreach($images as $image):?>
19 <?php if(!wmvc_show_data('wdk_listing_video_disabled',$settings, false) && wdk_file_extension_type(wmvc_show_data('src',$image)) == 'video'):?>
20 <div class="wdk-col">
21 <a class="wdk-listing-image-card">
22 <video controls src="<?php echo esc_url(wmvc_show_data('src',$image));?>" alt="<?php echo esc_attr(wmvc_show_data('alt',$image));?>" class="wdk-listing-image"></video>
23 </a>
24 </div>
25 <?php elseif(wdk_file_extension_type(wmvc_show_data('src',$image)) == 'image'):?>
26 <div class="wdk-col">
27 <a class="wdk-listing-image-card">
28 <img src="<?php echo esc_url(wmvc_show_data('src',$image));?>" class="wdk-listing-image" alt="<?php echo esc_attr(wmvc_show_data('alt',$image));?>">
29 </a>
30 </div>
31 <?php endif;?>
32 <?php endforeach;?>
33
34 <?php if(!empty($images) && 1 < wmvc_count($images)):?>
35 </div>
36 <div class="wdk-listing-carousel_arrows">
37 <a class="wdk-slider-prev wdk-listing-carousel_arrow">
38 <?php \Elementor\Icons_Manager::render_icon( $settings['styles_carousel_arrows_icon_left'], [ 'aria-hidden' => 'true' ] ); ?>
39 </a>
40 <a class="wdk-slider-next wdk-listing-carousel_arrow">
41 <?php \Elementor\Icons_Manager::render_icon( $settings['styles_carousel_arrows_icon_right'], [ 'aria-hidden' => 'true' ] ); ?>
42 </a>
43 </div>
44 </div>
45 <?php else:?>
46 </div>
47 <?php endif;?>
48 <?php endif;?>
49 </div>
50 <script>
51 jQuery(document).ready(function($){
52 $('#wdk_el_<?php echo esc_html($id_element);?> .wdk_listing_slider_ini').slick({
53 <?php if(1 == wmvc_count($images)):?>
54 dots: false,
55 arrows: false,
56 <?php else:?>
57 dots: true,
58 <?php endif;?>
59
60 <?php if(wmvc_show_data('layout_carousel_is_infinite', $settings) == 'true'):?>
61 infinite: <?php echo wmvc_show_data('layout_carousel_nav_is_infinite', $settings, 'true');?>,
62 <?php endif;?>
63
64 <?php if(!empty(wmvc_show_data('layout_carousel_speed', $settings))):?>
65 speed: <?php echo intval(wmvc_show_data('layout_carousel_nav_speed', $settings, 100));?>,
66 <?php endif;?>
67
68 <?php if(wmvc_show_data('layout_carousel_is_center', $settings) == 'true'):?>
69 centerMode: true,
70 <?php endif;?>
71
72 <?php if(wmvc_show_data('layout_carousel_is_autoplay', $settings) == 'true'):?>
73 autoplay: true,
74 <?php endif;?>
75
76 <?php if(!empty(wmvc_show_data('layout_carousel_autoplay_speed', $settings))):?>
77 autoplaySpeed: <?php echo intval(wmvc_show_data('layout_carousel_autoplay_speed', $settings, 2000));?>,
78 <?php endif;?>
79
80 <?php if(wmvc_show_data('layout_carousel_variableWidth', $settings) == 'true'):?>
81 variableWidth: true,
82 <?php endif;?>
83 nextArrow: $('#wdk_el_<?php echo esc_html($id_element);?> .wdk-listing-carousel_arrows .wdk-slider-next'),
84 prevArrow: $('#wdk_el_<?php echo esc_html($id_element);?> .wdk-listing-carousel_arrows .wdk-slider-prev'),
85 customPaging: function(slider, i) {
86 // this example would render "tabs" with titles
87 return '<span class="wdk_dot"><?php \Elementor\Icons_Manager::render_icon( $settings['styles_carousel_dots_icon'], [ 'aria-hidden' => 'true' ] ); ?></span>';
88 },
89 slidesToShow: <?php echo (!empty(trim(wmvc_show_data('styles_thmbn_nav_columns', $settings, '4')))) ? wmvc_show_data('styles_thmbn_nav_columns', $settings, '4') : 4;?>,
90 responsive: [
91 {
92 breakpoint: 991,
93 settings: {
94 slidesToShow: <?php echo (!empty(trim(wmvc_show_data('styles_thmbn_nav_columns_tablet', $settings, '3')))) ? wmvc_show_data('styles_thmbn_nav_columns_tablet', $settings, '3') : 3;?>,
95 }
96 },
97 {
98 breakpoint: 768,
99 settings: {
100 slidesToShow: <?php echo (!empty(trim(wmvc_show_data('styles_thmbn_nav_columns_mobile', $settings, '1')))) ? wmvc_show_data('styles_thmbn_nav_columns_mobile', $settings, '1') : 1;?>,
101 }
102 },
103 ]
104 });
105 })
106 </script>
107 </div>
108
109