Hi @Rad, hi there,
I’d love my blog posts to display all categories in hierarchical order. I’ve seen code snippets in several other threads but they did not accomplish what I need. This is what I have so far, but categories will be displayed in a weird (alphabetical?) order?
// Breadcrumbs
// =============================================================================
// See https://theme.co/apex/forum/t/pro-child-breadcrumbs-with-category-where-is-breadcrumbs-php/22940
add_filter('x_breadcrumbs_data', 'post_parent_trail', 999999, 2);
function post_parent_trail ($crumbs, $args) {
if ( is_singular('post') ) {
$category = get_the_category( get_the_ID() );
$numberOfCrumbs = count( $crumbs );
if ( count( $category ) > 0 ) {
for ($zaehler = 0; $zaehler < count( $category ); $zaehler++) {
$crumbs[$zaehler + $numberOfCrumbs]['label'] = $category[$zaehler]->name;
$crumbs[$zaehler + $numberOfCrumbs]['url'] = get_category_link( $category[$zaehler]->term_id );
}
}
}
return $crumbs;
}
I was hoping you would have a snippet available?
Cheers

