PluginProbe
WP Directory Kit / 1.3.8
WP Directory Kit v1.3.8
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.3.8, at elementor-elements/views/wdk-categories-grid-cover.php

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