-
We took that Code from the Support Forum:
/** * Filter to show all categories in breadcrumbs */ add_filter( 'rank_math/frontend/breadcrumb/items', function( $crumbs, $class ) { $get_post_categories = get_the_category(); if ($get_post_categories) { foreach($get_post_categories as $cat) { $cat_list= [ $cat->name, get_category_link( $cat->term_id ) ]; array_splice( $crumbs, 2, 0, array($cat_list) ); } } return $crumbs; }, 10, 2);
The Problem is that the Breadcrumbs showing up sometimes in correct order, and sometimes in wrong order.
A post has parent Cat and Child Cat in the Breadcrumbs it shows up as chil cat – parent cat
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The ticket ‘Breadcrum don’t always work’ is closed to new replies.