Genesis breadcrumbs

Breadcrumbs are links that show where you are in the site hierarchy. You can customise the breadcrumbs in several ways.

Modify home link

You can change the home link to another URL. Below is the code to modify the breadcrumbs home link:

[php title="functions.php"]
//* Modify Home breadcrumb link.
add_filter ( 'genesis_home_crumb', 'sp_breadcrumb_home_link' );
function sp_breadcrumb_home_link( $crumb ) {
	return preg_replace('/href="[^"]*"/', 'href="http://example.com/home"', $crumb);
}

[/php]

Reposition breadcrumbs

You can use the following code to choose where you want the breadcrumbs to show up in your theme:

[php title="functions.php"]
//* Reposition the breadcrumbs
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
add_action( 'genesis_after_header', 'genesis_do_breadcrumbs' );

[/php]

Modify breadcrumbs

You can customise the details of the breadcrumbs with the following code:

[php title="functions.php"]
//* Modify breadcrumb arguments.
add_filter( 'genesis_breadcrumb_args', 'sp_breadcrumb_args' );
function sp_breadcrumb_args( $args ) {
	$args['home'] = 'Home';
	$args['sep'] = ' / ';
	$args['list_sep'] = ', ';
	$args['prefix'] = '
<div class="breadcrumb">';
	$args['suffix'] = '</div>

';
	$args['heirarchial_attachments'] = true;
	$args['heirarchial_categories'] = true;
	$args['display'] = true;
	$args['labels']['prefix'] = 'You are here: ';
	$args['labels']['author'] = 'Archives for ';
	$args['labels']['category'] = 'Archives for ';
	$args['labels']['tag'] = 'Archives for ';
	$args['labels']['date'] = 'Archives for ';
	$args['labels']['search'] = 'Search for ';
	$args['labels']['tax'] = 'Archives for ';
	$args['labels']['post_type'] = 'Archives for ';
	$args['labels']['404'] = 'Not found: ';
return $args;
}

[/php]