• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

breadcrumbs – heirarchial_categories and alphabetical order

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › breadcrumbs – heirarchial_categories and alphabetical order

This topic is: not resolved

Tagged: breadcrumbs, class-genesis-breadcrumb.php

  • This topic has 1 reply, 2 voices, and was last updated 3 years, 5 months ago by Brad Dalton.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • September 19, 2019 at 11:31 am #493648
    kingmaico
    Member

    Hi,
    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 #494122
    Brad Dalton
    Participant

    I 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 );
    
    	}
    

    Tutorials for StudioPress Themes.

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble