PluginProbe
WP Directory Kit / 1.3.1
WP Directory Kit v1.3.1
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-categories-grid-cover.php

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

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