Skip to content

Snippet: Alter Home Link In Breadcrumbs

// Alter breadcrumbs home link URL
function my_alter_breadcrumbs_home_link( $args ) {
	$args['home_link'] = 'YOUR CUSTOM LINK';
	return $args;
add_filter( 'wpex_breadcrumbs_args', 'my_alter_breadcrumbs_home_link' );

// Alter breadcrumbs home link HTML
function my_alter_breadcrumbs_home_link_old( $trail ) {
	$trail['trail_start'] = '<span><a href="YOUR CUSTOM LINK HERE" title="YOUR TITLE" rel="home" class="trail-begin"><span>YOUR TITLE</span></a></span>';
	return $trail;
add_filter( 'wpex_breadcrumbs_trail', 'my_alter_breadcrumbs_home_link_old' );
All PHP snippets should be added via child theme's functions.php file or via a plugin. We recommend Code Snippets (100% Free) or WPCode (sponsored)
Back To Top