Skip to content

Instantly share code, notes, and snippets.

@jamesmthornton
Created December 17, 2019 20:47
Show Gist options
  • Save jamesmthornton/7a2008a707a91762b1f850555cdf64ce to your computer and use it in GitHub Desktop.
Save jamesmthornton/7a2008a707a91762b1f850555cdf64ce to your computer and use it in GitHub Desktop.
Remove "Home" link and trailing slash from breadcrumbs in Genesis themes
<?php
// Remove "Home" link and trailing slash from breadcrumbs in Genesis themes
add_filter( 'genesis_home_crumb', 'remove_home_breadcrumb' );
function remove_home_breadcrumb( $crumb ) {
$crumb = '';
}
@jamesmthornton
Copy link
Author

genesis_home_crumb hook and get_home_crumb function referenced in /wp-content/themes/genesis/lib/classes/breadcrumb.php

Rewriting $crumb var strips out the Home functionality, which in breadcrumb.php is
$crumb = ( is_home() && is_front_page() ) ? $this->args['home'] : $this->get_breadcrumb_link( $url, '', $this->args['home'] );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment