Community Forums › Forums › Archived Forums › General Discussion › breadcrumbs – heirarchial_categories and alphabetical order
Tagged: breadcrumbs, class-genesis-breadcrumb.php
- This topic has 1 reply, 2 voices, and was last updated 6 years, 7 months ago by
Brad Dalton.
-
AuthorPosts
-
September 19, 2019 at 11:31 am #493648
kingmaico
MemberHi,
There seems to be something weird in the breadcrumbs.I have a main category Producten
And subcategories.All subcategories appear in the breadcrumbs correctly like this:
Home / Producten / Meubilair & toebehoren / buffettafel
where Meubilair & toebehoren is the subcategory.
There is one exception. Products in the subcategory Tenten & hallen have no subcategory in the breadcrumbs, like this:
Home / Producten / Brandblusser
However if I change the title of this category to Hallen & tenten, it does show, like this:
Home / Producten / Hallen & tenten / Brandblusser
It looks like the subcategory only shows when the main category is alphabetically higher. I tested this and changed the title of the main category to aProducten.
Now none of the subcategories appear in the breadcrumbs.Any suggestions?
Best, Grietje
https://prins-vandermeer.nl/evenementenmateriaal/producten/October 19, 2019 at 4:09 am #494122Brad Dalton
ParticipantI would send this question to StudioPress support. Maybe it's a bug or a plugin/code conflict.
Or
Maybe it doesn't support term children
See this code in class-genesis-breadcrumb.php :
protected function get_category_crumb() { $crumb = $this->args['labels']['category'] . $this->get_term_parents( get_query_var( 'cat' ), 'category' ); /** * Filter the category archive breadcrumb. * * @since 1.9.0 * * @param string $crumb HTML markup for the category archive crumb. * @param array $args Arguments used to generate the breadcrumbs. Documented in Genesis_Breadcrumbs::get_output(). */ return apply_filters( 'genesis_category_crumb', $crumb, $this->args ); }And this :
protected function get_term_parents( $parent_id, $taxonomy, $link = false, array $visited = [] ) { $parent = get_term( (int) $parent_id, $taxonomy ); if ( is_wp_error( $parent ) ) { return ''; } if ( $parent->parent && ( $parent->parent !== $parent->term_id ) && ! in_array( $parent->parent, $visited, true ) ) { $visited[] = $parent->parent; $chain[] = $this->get_term_parents( $parent->parent, $taxonomy, true, $visited ); } if ( $link && ! is_wp_error( get_term_link( get_term( $parent->term_id, $taxonomy ), $taxonomy ) ) ) { $chain[] = $this->get_breadcrumb_link( get_term_link( get_term( $parent->term_id, $taxonomy ), $taxonomy ), '', $parent->name ); } else { $chain[] = $parent->name; } return implode( $this->args['sep'], $chain ); }
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.