woocommerce_breadcrumb

Introduction ↑ Back to top

Help your users navigate your website and keep track of their path using woocommerce_breadcrumb().

Note: This is a Developer level doc. If you are unfamiliar with code/templates and resolving potential conflicts, select a WooExpert or Developer for assistance. We are unable to provide support for customizations under our  Support Policy.

What is woocommerce_breadcrumb()? ↑ Back to top

The woocommerce_breadcrumb() outputs the WooCommerce Breadcrumb.

Parameters ↑ Back to top

Please note that all parameters are optional.

The $args array ↑ Back to top

  • delimiter – The character to display between the breadcrumbs.
  • wrap_before – The breadcrumb’s container starting code
  • wrap_after – The breadcrumb’s container ending code
  • before – HTML to display before the breadcrumbs.
  • after – HTML to display after the breadcrumbs.
  • home – Include the front page at the beginning of the breadcrumbs.

Filtering default arguments ↑ Back to top

You can easily change default arguments using the woocommerce_breadcrumb_defaults filter. Use the WordPress builtin add_filter() function.

Examples ↑ Back to top

Basic Usage ↑ Back to top

<?php woocommerce_breadcrumb(); ?>

Usage with custom arguments ↑ Back to top

In the example below, we’re using custom arguments to change the breadcrumb separator as well as the HTML to display before the breadcrumbs.

<?php
	$args = array(
			'delimiter' => '/',
			'before' => '<span class="breadcrumb-title">' . __( 'This is where you are:', 'woothemes' ) . '</span>'
	);
?>
<?php woocommerce_breadcrumb( $args ); ?>

WooCommerce - the most customizable eCommerce platform for building your online business.

Back to the top