D
D
dimonfreeman2021-07-21 14:13:20
WooCommerce
dimonfreeman, 2021-07-21 14:13:20

How to display all breadcrumbs in WooCommerce with dimox_breadcrumbs?

We have for categories and subcategories, but
it displays like
this

elseif (is_product_category()) {
            $parents = get_ancestors( get_query_var('cat'), 'category' );
            foreach ( array_reverse( $parents ) as $cat ) {
                $position += 1;
                if ( $position > 1 ) echo $sep;
                echo sprintf( $link, get_category_link( $cat ), get_cat_name( $cat ), $position );
            }
            if ( get_query_var( 'paged' ) ) {
                $position += 1;
                $cat = get_query_var('cat');
                echo $sep . sprintf( $link, get_category_link( $cat ), get_cat_name( $cat ), $position );
                echo $sep . $before . sprintf( $text['page'], get_query_var( 'paged' ) ) . $after;
            } else {
                if ( $show_current ) {
                    if ( $position >= 1 ) echo $sep;
                    echo $before . sprintf( $text['category'], single_cat_title( '', false ) ) . $after;
                } elseif ( $show_last_sep ) echo $sep;
            }
        }

and the whole code hl. crumbs of the author.
https://gist.github.com/Dimox/5654092

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dimonfreeman, 2021-07-21
@dimonfreeman

woocommerce_breadcrumb();
added and further edited them.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question