Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function wpf_breadcrumbs() {
- $category = get_query_var( 'documentation_category' );
- $category_term = get_term_by( 'slug', $category, 'documentation_category' );
- if ( empty( $category_term ) ) {
- return;
- }
- ob_start();
- ?>
- <ul class="pp-breadcrumbs">
- <li class="pp-breadcrumbs-item pp-breadcrumbs-item-cat">
- <a class="pp-breadcrumbs-crumb pp-breadcrumbs-crumb-link pp-breadcrumbs-crumb-cat" href="<?php echo home_url()?>/documentation/">Documentation</a>
- </li>
- <li class="pp-breadcrumbs-separator">
- <span class="pp-breadcrumbs-separator-text">/</span>
- </li>
- <li class="pp-breadcrumbs-item pp-breadcrumbs-item-cat">
- <a class="pp-breadcrumbs-crumb pp-breadcrumbs-crumb-link pp-breadcrumbs-crumb-cat" href="<?php echo home_url()?>/documentation/#<?php echo $category_term->slug ?>"><?php echo $category_term->name ?></a>
- </li>
- <li class="pp-breadcrumbs-separator">
- <span class="pp-breadcrumbs-separator-text">/</span>
- </li>
- <li class="pp-breadcrumbs-item pp-breadcrumbs-item-cat">
- <?php the_title(); ?>
- </li>
- </ul>
- <?php
- return ob_get_clean();
- }
- add_shortcode( 'wpf_breadcrumbs', 'wpf_breadcrumbs' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement