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-locations-carousel.php

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

101 lines 6.2 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 Locations Carousel.
4 * This is the template that elementor element carousel, slider, locations
5 *
6 */
7
8 if ( ! defined( 'ABSPATH' ) ) {
9 exit; // Exit if accessed directly.
10 }
11
12 ?>
13 <?php
14 $results_page = wmvc_show_data('conf_link', $settings);
15 if(!is_array($results_page) && !empty($results_page)) {
16 $results_page = get_permalink($results_page);
17 } else {
18 $results_page = get_permalink(wdk_get_option('wdk_results_page'));
19 }
20 ?>
21
22 <div class="wdk-element" id="wdk_el_<?php echo esc_html($id_element);?>">
23 <div class="wdk-locations-carousel">
24 <div class="wdk-location-slider-box <?php echo esc_attr($settings['layout_carousel_animation_style']).'_animation';?> <?php echo esc_attr(join(' ', [$settings['t_styles_dots_position_style'], $settings['t_styles_arrows_position_style'],$settings['t_styles_arrows_position'],$settings['t_styles_arrows_position_style']]));?>">
25 <div class="wdk-locations-carousel_ini <?php echo esc_html($settings['t_styles_img_des_type']);?> ">
26 <?php foreach ($results as $key => $item):?>
27 <div class="wdk-slider-item">
28 <img src="<?php echo esc_url(wdk_image_src($item, 'full', NULL,'image_id', 'image_path'));?>" class="wdk-slider-item_thumbnail" alt="<?php echo esc_html(wmvc_show_data('location_title', $item));?>">
29 <div class="wdk-locations-carousel_mask"></div>
30 <?php if(!empty(wmvc_show_data('location_title', $item))):?>
31 <div class="wdk-slider-item_box_line"> <div class="wdk-slider-item_box_title"> <?php echo esc_html(wmvc_show_data('location_title', $item));?> </div></div>
32 <?php endif;?>
33 <div class="wdk-slider-item_box_line"> <div class="wdk-slider-item_box_content"> <?php echo esc_html(wmvc_show_data('listings_counter', $item));?> <?php echo esc_html__('Listings','wpdirectorykit');?> </div></div>
34 <div class="wdk-slider-item_box_line"> <a class="wdk-slider-item_box_link" href="<?php echo esc_url(wdk_url_suffix($results_page,'search_location='.wmvc_show_data('idlocation', $item)));?>#results"> <?php echo esc_html($settings['t_content_basic_link_text']);?> </a></div>
35 <?php if(!wmvc_show_data('complete_link_enable', $item) == 'yes'):?>
36 <a class="wdk-slider-complete_link" href="<?php echo esc_url(wdk_url_suffix($results_page,'search_location='.wmvc_show_data('idlocation', $item)));?>#results"></a>
37 <?php endif;?>
38 </div>
39 <?php endforeach;?>
40 </div>
41 <?php if(!empty($results) && wmvc_show_data('layout_carousel_columns', $settings,1) < wmvc_count($results)):?>
42 <div class="wdk-locations-carousel_arrows">
43 <a class="wdk-slider-prev wdk-locations-carousel_arrow">
44 <?php \Elementor\Icons_Manager::render_icon( $settings['styles_carousel_arrows_icon_left'], [ 'aria-hidden' => 'true' ] ); ?>
45 </a>
46 <a class="wdk-slider-next wdk-locations-carousel_arrow">
47 <?php \Elementor\Icons_Manager::render_icon( $settings['styles_carousel_arrows_icon_right'], [ 'aria-hidden' => 'true' ] ); ?>
48 </a>
49 </div>
50 <?php endif;?>
51 </div>
52 </div>
53 </div>
54 <script>
55 jQuery(document).ready(function($){
56 $('#wdk_el_<?php echo esc_html($id_element);?> .wdk-locations-carousel_ini').slick({
57 <?php if(!empty($results) && wmvc_show_data('layout_carousel_columns', $settings,1) < wmvc_count($results)):?>
58 dots: true,
59 arrows: true,
60 <?php else:?>
61 dots: false,
62 arrows: false,
63 <?php endif;?>
64 <?php if($settings['layout_carousel_center']=='yes'):?>
65 centerMode: true,
66 <?php endif;?>
67 <?php if($settings['layout_carousel_variableWidth']=='yes'):?>
68 variableWidth: true,
69 <?php endif;?>
70 speed: '<?php echo esc_html($settings['layout_carousel_speed'], '100');?>',
71 slidesToShow: <?php echo wmvc_show_data('layout_carousel_columns', $settings, 1);?>,
72 slidesToScroll: <?php echo wmvc_show_data('layout_carousel_columns', $settings,1);?>,
73 <?php if(!empty(wmvc_show_data('layout_carousel_is_infinite', $settings))):?>
74 infinite: <?php echo wmvc_show_data('layout_carousel_is_infinite', $settings, 'true');?>,
75 <?php endif;?>
76 <?php if(!empty(wmvc_show_data('layout_carousel_is_autoplay', $settings))):?>
77 autoplay: <?php echo wmvc_show_data('layout_carousel_is_autoplay', $settings, 'false');?>,
78 autoplaySpeed: <?php echo wmvc_show_data('layout_carousel_autoplaySpeed', $settings, '1500');?>,
79 <?php endif;?>
80 <?php if(wmvc_show_data('layout_carousel_columns', $settings, 1) == 1 && in_array($settings['layout_carousel_animation_style'], ['fade','fade_in_in'])):?>
81 fade: true,
82 <?php endif;?>
83 cssEase: '<?php echo esc_html($settings['layout_carousel_cssease'], 'linear');?>',
84 nextArrow: $('#wdk_el_<?php echo esc_html($id_element);?> .wdk-locations-carousel_arrows .wdk-slider-next'),
85 prevArrow: $('#wdk_el_<?php echo esc_html($id_element);?> .wdk-locations-carousel_arrows .wdk-slider-prev'),
86 customPaging: function(slider, i) {
87 // this example would render "tabs" with titles
88 return '<span class="wdk_lr_dot"><?php \Elementor\Icons_Manager::render_icon( $settings['styles_carousel_dots_position_style'], [ 'aria-hidden' => 'true' ] ); ?></span>';
89 },
90 responsive: [
91 {
92 breakpoint: 600,
93 settings: {
94 slidesToShow: 1,
95 slidesToScroll: 1
96 }
97 },
98 ]
99 });
100 })
101 </script>