PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 4.2.6
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v4.2.6
4.9.4 4.9.3 4.9.2 4.9.1 4.9.0 4.8.2 4.8.1 4.8.0 4.7.0 4.6.2 4.6.1 4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 4.5.1 4.5.0 4.4.1 4.4.0 3.3.4 3.4.0 3.4.1 3.4.2 All 202 releases
betterdocs / views / templates / taxonomy-doc_tag.php

taxonomy-doc_tag.php in BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot 4.2.6, at views/templates/taxonomy-doc_tag.php

110 lines 3.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Template archive docs
5 *
6 * @link https://wpdeveloper.com
7 * @since 1.0.0
8 *
9 * @package BetterDocs
10 * @subpackage BetterDocs/public
11 */
12
13 get_header();
14
15 $view_object = betterdocs()->views;
16 $layout = betterdocs()->customizer->defaults->get( 'betterdocs_archive_layout_select', 'layout-7' );
17 $title_tag = betterdocs()->customizer->defaults->get( 'betterdocs_archive_title_tag', 'h2' );
18 $title_tag = betterdocs()->template_helper->is_valid_tag( $title_tag );
19 $current_category = get_queried_object();
20 $content_area_classes = [
21 'betterdocs-content-wrapper betterdocs-display-flex',
22 "doc-category-$layout"
23 ];
24 ?>
25
26 <div class="betterdocs-wrapper betterdocs-taxonomy-wrapper betterdocs-category-archive-wrapper betterdocs-wraper">
27 <?php betterdocs()->template_helper->search(); ?>
28
29 <div class="<?php echo esc_attr( implode( ' ', $content_area_classes ) ); ?>">
30 <?php betterdocs()->template_helper->sidebar( $layout, 'template' ); ?>
31
32 <div id="main" class="betterdocs-content-area">
33 <div class="betterdocs-content-inner-area">
34 <?php
35 $view_object->get(
36 'templates/parts/mobile-nav',
37 [
38 'mobile_sidebar' => true,
39 'mobile_toc' => false
40 ]
41 );
42 /**
43 * Breadcrumbs
44 */
45 $view_object->get( 'templates/parts/breadcrumbs' );
46 ?>
47
48 <div class="betterdocs-entry-title">
49 <?php echo wp_sprintf( '<%1$s class="docs-cat-heading">%2$s</%1$s>', 'h3', $current_category->name ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
50 </div>
51
52 <div class="betterdocs-entry-body betterdocs-taxonomy-doc-category">
53 <?php
54 $_tax_query = [
55 [
56 'taxonomy' => 'doc_tag',
57 'field' => 'slug',
58 'terms' => isset( $current_category->slug ) ? $current_category->slug : ''
59 ]
60 ];
61 $post_query = betterdocs()->query->get_posts(
62 [
63 'term_id' => isset( $current_category->term_id ) ? $current_category->term_id : '',
64 'term_slug' => isset( $current_category->slug ) ? $current_category->slug : '',
65 'posts_per_page' => -1,
66 'tax_query' => apply_filters( 'betterdocs_tag_tax_query', $_tax_query, $current_category )
67 ]
68 );
69
70 $custom_icon = betterdocs()->customizer->defaults->get( 'betterdocs_archive_list_icon' );
71 $settings_list_icon = betterdocs()->settings->get( 'docs_list_icon' );
72 if ( ! $custom_icon && $settings_list_icon ) {
73 $custom_icon = $settings_list_icon['url'];
74 }
75
76 if ( $post_query->have_posts() ) :
77 ?>
78 <ul>
79 <?php
80 while ( $post_query->have_posts() ) :
81 $post_query->the_post();
82 if ( $custom_icon ) {
83 $icon = '<img src="' . esc_url( $custom_icon ) . '" />';
84 } else {
85 $icon = betterdocs()->template_helper->icon();
86 }
87 echo wp_sprintf(
88 '<li>%s<a href="%s">%s</a></li>',
89 $icon, //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
90 esc_attr( esc_url( get_the_permalink() ) ),
91 betterdocs()->template_helper->kses( get_the_title() ) //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
92 );
93 endwhile;
94 wp_reset_postdata();
95 ?>
96 </ul>
97 <?php
98 else :
99 echo '<p class="nothing-here">' . esc_html__( 'Sorry, no docs were found.', 'betterdocs' ) . '</p>';
100 endif; // $post_query->have_posts()
101 ?>
102 </div>
103 </div>
104 </div>
105 </div>
106 </div>
107
108 <?php
109 get_footer();
110