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-categories-grid-cover.php

wdk-categories-grid-cover.php in WP Directory Kit 1.5.9, at elementor-elements/views/wdk-categories-grid-cover.php

173 lines 9.8 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 categories Grid Cover.
4 * This is the template that elementor element categories, images, links
5 *
6 */
7
8 if ( ! defined( 'ABSPATH' ) ) {
9 exit; // Exit if accessed directly.
10 }
11
12 ?>
13
14 <?php
15 $results_page = wmvc_show_data('conf_link', $settings);
16 if(!is_array($results_page) && !empty($results_page)) {
17 //$results_page = get_permalink($results_page);
18 } else {
19 $results_page = wdk_get_option('wdk_results_page');
20 }
21
22 //get translation page
23 if(function_exists('PLL'))
24 {
25 $results_page = pll_get_post($results_page);
26 }
27
28 $results_page = get_permalink($results_page);
29
30 ?>
31
32 <div class="wdk-element" id="wdk_el_<?php echo esc_html($id_element);?>">
33
34 <div class="wdk-categories-grid-cover">
35
36 <?php if($settings['enable_carousel'] == 'yes'):?>
37 <div class="wdk_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']]));?>">
38 <div class="wdk_slider_body">
39 <div class="wdk_slider_ini">
40 <?php else:?>
41 <div class="wdk-row <?php if(isset($settings['is_mobile_view_enable']) && $settings['is_mobile_view_enable'] == 'yes'):?> WdkScrollMobileSwipe_enable <?php endif;?>">
42 <?php endif;?>
43
44 <?php if(count($results) > 0):?>
45 <?php foreach ($results as $key => $value):?>
46 <div class="wdk-col">
47 <div class="wdk-categories-card-cover">
48 <?php if(wmvc_show_data('layout_image_type', $settings) == 'icon'):?>
49 <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('category_title', $value));?>" class="wdk-icon">
50 <?php else:?>
51 <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'image_id', 'image_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('category_title', $value));?>" class="wdk-image">
52 <?php endif;?>
53 <div class="wdk-categories-card-body">
54 <div class="wdk-action-left">
55 <?php if(wmvc_show_data('content_icon_type', $settings) == 'image' && wdk_image_src($value, 'full', NULL,'icon_id')):?>
56 <img src="<?php echo esc_url(wdk_image_src($value, 'full',NULL,'icon_id', 'icon_path'));?>" alt="<?php echo esc_attr(wmvc_show_data('category_title', $value));?>">
57 <?php elseif(wmvc_show_data('content_icon_type', $settings) == 'font'):?>
58 <i class="<?php echo esc_attr(wmvc_show_data('font_icon_code', $value,''));?>"></i>
59 <?php endif;?>
60 </div>
61 <div class="wdk-left-content">
62 <h3 class="wdk-title"><?php echo esc_html(wmvc_show_data('category_title', $value));?></h3>
63 <span class="wdk-listings-count">
64 <?php
65 /* translators: 1: Number of listings. */
66 echo esc_html(wdk_sprintf(_nx(
67 '%1$s Listing',
68 '%1$s Listings',
69 wmvc_show_data('listings_counter', $value, '0'),
70 'profile listings count',
71 'wpdirectorykit'
72 ), wmvc_show_data('listings_counter', $value, '0')));
73 ?>
74 </span>
75 </div>
76 <div class="wdk-action-right">
77 <a class="wdk-category-btn" href="<?php echo esc_url(wdk_url_suffix($results_page,'search_category='.wmvc_show_data('idcategory', $value)));?>#results">
78 <?php \Elementor\Icons_Manager::render_icon( $settings['link_icon'], [ 'aria-hidden' => 'true' ] ); ?>
79 </a>
80 </div>
81 </div>
82 <a href="<?php echo esc_url(wdk_url_suffix($results_page,'search_category='.wmvc_show_data('idcategory', $value)));?>#results" class="wdk-link"></a>
83 <div class="mask"></div>
84 <div class="overlay"></div>
85 </div>
86 </div>
87 <?php endforeach;?>
88 <?php else:?>
89 <div class="wdk-col wdk-col-full wdk-col-full-always">
90 <p class="wdk_alert wdk_alert-danger"><?php echo esc_html__('categories not found', 'wpdirectorykit');?></p>
91 </div>
92 <?php endif;?>
93
94 <?php if($settings['enable_carousel'] == 'yes'):?>
95 </div>
96 <div class="wdk_slider_arrows">
97 <a title="<?php echo esc_attr__('prev slider', 'wpdirectorykit');?>" href="#" class="wdk-slider-prev wdk_lr_slider_arrow">
98 <?php \Elementor\Icons_Manager::render_icon( $settings['styles_carousel_arrows_icon_left'], [ 'aria-hidden' => 'true' ] ); ?>
99 </a>
100 <a title="<?php echo esc_attr__('next slider', 'wpdirectorykit');?>" href="#" class="wdk-slider-next wdk_lr_slider_arrow">
101 <?php \Elementor\Icons_Manager::render_icon( $settings['styles_carousel_arrows_icon_right'], [ 'aria-hidden' => 'true' ] ); ?>
102 </a>
103 </div>
104 </div>
105 </div>
106 <?php else:?>
107 </div>
108 <?php endif;?>
109 </div>
110 <?php if($settings['enable_carousel'] == 'yes'):?>
111 <script>
112 jQuery(document).ready(function($){
113 var el = $('#wdk_el_<?php echo esc_html($id_element);?> .wdk_slider_ini').slick({
114 dots: true,
115 arrows: true,
116 slidesToShow: <?php echo (!empty(trim(wmvc_show_data('layout_carousel_columns', $settings, '3')))) ? esc_html(wmvc_show_data('layout_carousel_columns', $settings, '3')) : 3;?>,
117 slidesToScroll: <?php echo (!empty(trim(wmvc_show_data('layout_carousel_columns', $settings, '3')))) ? esc_html(wmvc_show_data('layout_carousel_columns', $settings, '3')) : 3;?>,
118 <?php if(!empty(wmvc_show_data('layout_carousel_is_infinite', $settings))):?>
119 infinite: <?php echo esc_js(wmvc_show_data('layout_carousel_is_infinite', $settings, 'true'));?>,
120 <?php endif;?>
121 <?php if(!empty(wmvc_show_data('layout_carousel_is_autoplay', $settings))):?>
122 autoplay: <?php echo esc_js(wmvc_show_data('layout_carousel_is_autoplay', $settings, 'false'));?>,
123 <?php endif;?>
124 nextArrow: $('#wdk_el_<?php echo esc_html($id_element);?> .wdk_slider_arrows .wdk-slider-next'),
125 prevArrow: $('#wdk_el_<?php echo esc_html($id_element);?> .wdk_slider_arrows .wdk-slider-prev'),
126 customPaging: function(slider, i) {
127 // this example would render "tabs" with titles
128 return '<span class="wdk_lr_dot"><?php \Elementor\Icons_Manager::render_icon( $settings['styles_carousel_dots_icon'], [ 'aria-hidden' => 'true' ] ); ?></span>';
129 },
130 responsive: [
131 {
132 breakpoint: 991,
133 settings: {
134 slidesToShow: <?php echo (!empty(trim(wmvc_show_data('layout_carousel_columns_tablet', $settings, '2')))) ? esc_html(wmvc_show_data('layout_carousel_columns_tablet', $settings, '2')) : 2;?>,
135 slidesToScroll: <?php echo (!empty(trim(wmvc_show_data('layout_carousel_columns_tablet', $settings, '2')))) ? esc_html(wmvc_show_data('layout_carousel_columns_tablet', $settings, '2')) : 2;?>,
136 }
137 },
138 {
139 breakpoint: 768,
140 settings: {
141 slidesToShow: <?php echo (!empty(trim(wmvc_show_data('layout_carousel_columns_mobile', $settings, '1')))) ? esc_html(wmvc_show_data('layout_carousel_columns_mobile', $settings, '1')) : 1;?>,
142 slidesToScroll: <?php echo (!empty(trim(wmvc_show_data('layout_carousel_columns_mobile', $settings, '1')))) ? esc_html(wmvc_show_data('layout_carousel_columns_mobile', $settings, '1')) : 1;?>,
143 }
144 },
145 ]
146 }).on('breakpoint', function(event, slick, breakpoint){
147 wdk_result_listings_thumbnail_slider(el);
148
149 if (typeof wdk_favorite == 'function') {
150 wdk_favorite('.wdk_slider_ini');
151 }
152
153 if (typeof wdk_init_compare_elem == 'function') {
154 wdk_init_compare_elem();
155 }
156 });
157
158 wdk_slick_slider_init(el, ()=>{
159 wdk_result_listings_thumbnail_slider(el);
160
161 if (typeof wdk_favorite == 'function') {
162 wdk_favorite('.wdk_slider_ini');
163 }
164
165 if (typeof wdk_init_compare_elem == 'function') {
166 wdk_init_compare_elem();
167 }
168 });
169 })
170 </script>
171 <?php endif;?>
172 </div>
173