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-tree.php

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

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