Last active
May 13, 2022 14:02
-
-
Save dwtompkins/bacc8b5f16ad2e13c86f2661bfe32c65 to your computer and use it in GitHub Desktop.
Genesis Framework - Breadcrumbs (functions.php)
This file contains hidden or 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 // Don't include the opening PHP tag if you're already inside PHP tags! | |
/* Remove "You are here:" from breadcrumbs */ | |
add_filter('genesis_breadcrumb_args', 'remove_breadcrumbs_yourarehere_text'); | |
function remove_breadcrumbs_yourarehere_text( $args ) { | |
$args['labels']['prefix'] = ''; | |
return $args; | |
} | |
/* Change breadcrumbs separator from "/" to "|" */ | |
add_filter('genesis_breadcrumb_args', 'modify_separator_breadcrumbs'); | |
function modify_separator_breadcrumbs($args) { | |
$args['sep'] = '<span class="separator"> | </span>'; | |
return $args; | |
} | |
/* Add shortcode to display Genesis Breadcrumbs */ | |
add_shortcode( 'breadcrumbs', 'breadcrumbs_shortcode' ); | |
function breadcrumbs_shortcode() { | |
ob_start(); | |
genesis_breadcrumb(); | |
return ob_get_clean(); | |
} | |
add_filter( 'widget_text', 'do_shortcode' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment