Customize Breadcrumbs for Custom Post Types Using Genesis Framework
If you have a Custom Post Type (CPT) named event, Genesis automatically shows events as parent of this page at the breadcrumbs display. If you want to show a specific site instead, you can use the snippet below:
add_filter( 'genesis_single_crumb', 'wpkb_crumb_for_events' , 10, 2 );
// Modifies the breadcrumb for events
function wpkb_crumb_for_events( $crumb, $args ){
global $post;
if ( !is_singular('event') ) {
return $crumb;
}
$search_for = '/Events/'; // modify as desired
$parent_page_id = 283; // ID of desired page
$link = get_permalink($parent_page_id);
$title = get_the_title($parent_page_id);
$replace = '<a href="'. $link .'">'. $title .'</a>';
return preg_replace($search_for, $replace, $crumb);
}