Created
February 21, 2016 21:12
-
-
Save joshuadavidnelson/a66766ab44f6ebf5f06b to your computer and use it in GitHub Desktop.
Filter out the "home" from genesis breadcrumbs.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Remove the "home" value from the genesis breadcrumbs. | |
* | |
* @since 1.0.0 | |
* | |
* @param array $crumbs | |
* @param array $args | |
* @return array | |
*/ | |
function chelan_breadcrumb_remove_home( $crumbs, $args ) { | |
// Pull out the first entry | |
if( isset( $crumbs[0] ) ) { | |
unset( $crumbs[0] ); | |
// Shift the indexes | |
$crumbs = array_values( array_filter( $crumbs ) ); | |
} | |
return $crumbs; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment