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!