PluginProbe
WP Directory Kit / 1.3.4
WP Directory Kit v1.3.4
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-tree.php

wdk-categories-tree.php in WP Directory Kit 1.3.4, at elementor-elements/views/wdk-categories-tree.php

125 lines 7.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 List.
4 * This is the template that elementor element list, categories results
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 $categories_count = 0;
22 $more_helper_class = '';
23 ?>
24
25 <div class="wdk-element" id="wdk_el_<?php echo esc_html($id_element);?>">
26 <div class="wdk-categories-tree">
27
28 <div class="wdk-row">
29 <?php if(!empty($categories)):?>
30 <div class="wdk-col">
31 <div class="category-block">
32 <?php foreach ($categories as $key => $value):?>
33 <?php if(wmvc_show_data('parent_id', $value) == 0):?>
34 <?php
35 if($categories_count == wmvc_show_data('conf_limit_root', $settings)):
36
37
38 if(wmvc_show_data('show_more', $settings) == 'yes'){?>
39 </ul>
40 </div>
41 </div>
42 <div class="wdk-col wdk-col-full wdk-col-full-always row-more-toogle">
43 <a href="#" class="btn-more"><?php echo esc_html__('Show More', 'wpdirectorykit');?></a>
44 </div>
45 <div class="wdk-col">
46 <div class="category-block more wdk-hidden">
47 <?php
48 $more_helper_class = ' more wdk-hidden';
49 $categories_count++;
50 $categories_sub_count = 0;
51 } else {
52 break;
53 }
54
55 else:
56
57 $categories_count++;
58 $categories_sub_count = 0;
59 ?>
60 <?php if($key != 0):?>
61 </ul>
62 </div>
63 </div>
64 <div class="wdk-col">
65 <div class="category-block <?php echo esc_attr($more_helper_class);?>">
66 <?php endif;?>
67 <?php endif;?>
68 <h3 class="title <?php if(wmvc_show_data('show_icon', $settings) == 'yes' && wmvc_show_data('layout_image_type', $settings) == 'image'):?> image_top <?php endif;?>">
69 <?php if(wmvc_show_data('show_icon', $settings) == 'yes'):?>
70 <?php if(wmvc_show_data('layout_image_type', $settings) == 'icon'):?>
71 <a href="<?php echo esc_url(wdk_url_suffix($results_page,'search_category='.wmvc_show_data('idcategory', $value)));?>#results">
72 <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">
73 </a>
74 <?php elseif(wmvc_show_data('layout_image_type', $settings) == 'image'):?>
75 <a class="wdk-d-block" href="<?php echo esc_url(wdk_url_suffix($results_page,'search_category='.wmvc_show_data('idcategory', $value)));?>#results">
76 <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">
77 </a>
78 <?php elseif(wmvc_show_data('layout_image_type', $settings) == 'font_icon'):?>
79 <span class="wdk-font-icon" style="background-color: <?php echo esc_attr(wmvc_show_data('category_color', $value));?>;"><i class="<?php echo esc_attr(wmvc_show_data('font_icon_code', $value));?>"></i></span>
80 <?php endif;?>
81 <?php endif;?>
82 <a href="<?php echo esc_url(wdk_url_suffix($results_page,'search_category='.wmvc_show_data('idcategory', $value)));?>#results">
83 <?php echo wmvc_show_data('category_title', $value);?>
84 </a>
85 </h3>
86 <ul class="wdk-categories">
87 <?php else:?>
88 <?php
89 if($categories_sub_count >= wmvc_show_data('conf_limit_sub', $settings)) {
90 if(wmvc_show_data('show_more_subs',$settings, false) == 'yes') {
91 if($categories_sub_count == wmvc_show_data('conf_limit_sub', $settings)):
92 ?>
93 <li class="wdk-item wdk-item-toggle">
94 <a href="#" class="wdk-link wdk-link-show-more">
95 <?php \Elementor\Icons_Manager::render_icon( $settings['item_icon_i'], [ 'aria-hidden' => 'true' ] );?>
96 <span class="wdk-title"><?php echo esc_html__('Show more...', 'wpdirectorykit');?></span>
97 </a>
98 </li>
99 <?php endif;
100 } else {
101 continue;
102 }
103 }
104 $categories_sub_count++;
105 ?>
106 <li class="wdk-item <?php echo ($categories_sub_count > wmvc_show_data('conf_limit_sub', $settings)) ? 'more-sub' : '';?>" <?php echo ($categories_sub_count > wmvc_show_data('conf_limit_sub', $settings)) ? 'style="display: none;"' : '';?>>
107 <a href="<?php echo esc_url(wdk_url_suffix($results_page,'search_category='.wmvc_show_data('idcategory', $value)));?>#results" class="wdk-link">
108 <?php \Elementor\Icons_Manager::render_icon( $settings['item_icon_i'], [ 'aria-hidden' => 'true' ] );?>
109 <span class="wdk-title"><?php echo wmvc_show_data('category_title', $value);?></span>
110 <span class="wdk-count"><?php echo wmvc_show_data('listings_counter', $value, 0);?></span>
111 </a>
112 </li>
113 <?php endif;?>
114 <?php endforeach;?>
115 </ul>
116 </div>
117 </div>
118 <?php else:?>
119 <div class="wdk-col wdk-col-full wdk-col-full-always">
120 <p class="wdk_alert wdk_alert-danger"><?php echo esc_html__('Categories not found', 'wpdirectorykit');?></p>
121 </div>
122 <?php endif;?>
123 </div>
124 </div>
125 </div>