Fix breadcrumbs for regular categories

Closes #16455
This commit is contained in:
Mike Jolley 2017-08-16 11:22:22 +01:00
parent 812ee4b917
commit 3aee17faeb
1 changed files with 2 additions and 3 deletions

View File

@ -155,7 +155,7 @@ class WC_Breadcrumb {
} else {
$cat = current( get_the_category( $post ) );
if ( $cat ) {
$this->term_ancestors( $cat->term_id, 'post_category' );
$this->term_ancestors( $cat->term_id, 'category' );
$this->add_crumb( $cat->name, get_term_link( $cat ) );
}
}
@ -247,8 +247,7 @@ class WC_Breadcrumb {
$this_category = get_category( $GLOBALS['wp_query']->get_queried_object() );
if ( 0 != $this_category->parent ) {
$this->term_ancestors( $this_category->parent, 'post_category' );
$this->add_crumb( $this_category->name, get_category_link( $this_category->term_id ) );
$this->term_ancestors( $this_category->term_id, 'category' );
}
$this->add_crumb( single_cat_title( '', false ), get_category_link( $this_category->term_id ) );