Categories::ap_breadcrumbs( array $navs )
Description #
Add category nav in AnsPress breadcrumbs.
Parameters #
- $navsarray (Required) Breadcrumbs nav array.
Source #
File: addons/categories/categories.php
479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 | public function ap_breadcrumbs( $navs ) { if ( is_question() && taxonomy_exists( 'question_category' ) ) { $cats = get_the_terms( get_question_id(), 'question_category' ); if ( $cats ) { $navs [ 'category' ] = array ( 'title' => $cats [0]->name, 'link' => get_term_link( $cats [0], 'question_category' ), 'order' => 2, ); } } elseif ( is_question_category() ) { $category = get_queried_object(); $navs [ 'page' ] = array ( 'title' => __( 'Categories' , 'anspress-question-answer' ), 'link' => ap_get_link_to( 'categories' ), 'order' => 8, ); $navs [ 'category' ] = array ( 'title' => $category ->name, 'link' => get_term_link( $category , 'question_category' ), 'order' => 8, ); } elseif ( is_question_categories() ) { $navs [ 'page' ] = array ( 'title' => __( 'Categories' , 'anspress-question-answer' ), 'link' => ap_get_link_to( 'categories' ), 'order' => 8, ); } return $navs ; } |
Expand full source code Collapse full source code View on GitHub: addons/categories/categories.php:479
Add your comment