Last active
October 22, 2020 08:54
-
-
Save rickrduncan/7009158 to your computer and use it in GitHub Desktop.
Customize Genesis breadcrumb
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 | |
//* Do NOT include the opening php tag | |
//* Change the word 'Home' that is at the front of breadcrumb trail | |
add_filter( 'genesis_breadcrumb_args', 'b3m_home_text_breadcrumb' ); | |
function b3m_home_text_breadcrumb( $args ) { | |
$args['home'] = 'Home'; | |
return $args; | |
} |
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 | |
//* Do NOT include the opening php tag | |
//* Change the 'Home' link to point to a different URL | |
add_filter ( 'genesis_home_crumb', 'b3m_breadcrumb_home_link' ); | |
function b3m_breadcrumb_home_link( $crumb ) { | |
return preg_replace('/href="[^"]*"/', 'href="http://www.rickrduncan.com"', $crumb); | |
} |
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 | |
//* Do NOT include the opening php tag | |
//* Remove 'You are here' from the front of breadcrumb trail | |
add_filter( 'genesis_breadcrumb_args', 'b3m_prefix_breadcrumb' ); | |
function b3m_prefix_breadcrumb( $args ) { | |
$args['labels']['prefix'] = ''; | |
return $args; | |
} |
I don't need the Home part of the breadcrumb so I left prefix blank 'prefix' => __( '', 'genesis' ),
Which removed the Home text does anybody know how to remove the first / that would come after the Home text
Right now my breadcrumb looks like /Page1 / Page2/ I would like to remove the / in front of Page1.
Thanks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to add this breadcubs in category page???