Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php // phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase.
- /**
- * The template for displaying taxonomy archives
- *
- * Used to display KB section archives if no archive template is found in the theme folder.
- *
- * If you'd like to further customize the single views, you may create a
- * taxonomy-wzkb_category.php file in your theme's folder
- *
- * @package WebberZone\Knowledge_Base
- */
- global $wp_query;
- $wzkb_current_taxonomy = $wp_query->get_queried_object();
- /* This plugin uses the Archive file of TwentyFifteen theme as an example */
- get_header();
- // Hide the first level header when displaying the category archives.
- $wzkb_inline_css = '
- .wzkb-section-name-level-1 {
- display: none;
- }
- ';
- wp_add_inline_style( 'wz-knowledgebase-styles', $wzkb_inline_css );
- ?>
- <a href="#main" class="skip-link screen-reader-text"><?php esc_html_e( 'Skip to content', 'knowledgebase' ); ?></a>
- <div class="wrap wzkb-wrap">
- <div id="wzkb-content-primary" class="content-area">
- <main id="main" class="site-main" role="main">
- <?php if ( have_posts() ) : ?>
- <!-- First, display the breadcrumb -->
- <?php wzkb_breadcrumb(); ?>
- <!-- Then, display the search form -->
- <?php wzkb_search_form(); ?>
- <!-- Now, display the header below the breadcrumb -->
- <header class="page-header">
- <h1 class="page-title"><?php echo esc_html( $wzkb_current_taxonomy->name ); ?></h1>
- </header><!-- .page-header -->
- <?php
- // Display knowledge base content for this category.
- $wzkb_knowledge_args = array(
- 'category' => $wzkb_current_taxonomy->term_id,
- 'extra_class' => 'wzkb-category-archive',
- );
- echo wzkb_knowledge( $wzkb_knowledge_args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
- // If no content, include the "No posts found" template.
- else :
- get_template_part( 'content', 'none' );
- endif;
- ?>
- </main><!-- .site-main -->
- </div><!-- .content-area -->
- <?php
- if ( wzkb_get_option( 'show_sidebar' ) ) {
- include_once 'sidebar-primary.php';
- }
- ?>
- </div><!-- .wrap.wzkb-wrap -->
- <?php
- get_footer();
Advertisement
Add Comment
Please, Sign In to add comment