WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
[resolved] Breadcrumbs displaying wrong order? (7 posts)

  1. mreider
    Member
    Posted 3 years ago #

    I have a site where the structure is:
    home - widgets - red widget - small red widget (this one being the post)

    However the breadcrumbs function is showing:
    home - red widget - widgets - small red widget

    Is this the way the breadcrumbs are supposed to be displaying? Seems backwards.

  2. Joost de Valk
    Member
    Plugin Author

    Posted 3 years ago #

    Haha, that could be a pretty stupid bug :) Is this using a custom taxonomy, by any chance?

  3. mreider
    Member
    Posted 3 years ago #

    Wait!

    It seems that it happens with multiple sub categories

    So if I have:

    Home - Sub1 - Sub2 - Sub3

    The breadcrumbs show:
    Home - Sub2 - Sub1 - Sub3

    If there are just two sub categories:

    Home - Sub1 - Sub 2

    The breadcrumbs are displayed correctly.

    Strange!

  4. Joost de Valk
    Member
    Plugin Author

    Posted 3 years ago #

    Thanks! Found and fixed for version 0.2.5.3.

  5. mreider
    Member
    Posted 3 years ago #

    Thanks for the quick help! I'll give it a shot now -well, when it's released :)

  6. Joost de Valk
    Member
    Plugin Author

    Posted 3 years ago #

    Just released it, should be available for download in a bit.

  7. Verzenden
    Member
    Posted 3 years ago #

    The update still does not fix the issue entirely. It's working fine for the single page but not on the archives page. This occurs when a category has a parent category.

    Home>Products>Fruits>Apple = single page
    Home>Fruits>Products = archive page

    To solve this I first tried adding:

    if ( count( $parents ) > 1 ) {
    		$parents = array_reverse( $parents );
    	}

    to the get_term_parents function inside class-breadcrumbs.php

    But this reverses the problem, now the archive page is displayed correctly but the single post page breadcrumb not.

    So I added an extra condition to the function so the code now looks like this:

    if ( count( $parents ) > 1 && is_archive()) {
    		$parents = array_reverse( $parents );
    	}

    This seems to fix it for me!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic