Last active
April 25, 2025 03:45
-
-
Save wplit/822593b19e74c2e9ea70a1a6f51b1c79 to your computer and use it in GitHub Desktop.
example changing breadcrumb
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 | |
add_filter( 'bricksextras/breadcrumbs/', function( $crumbs ) { | |
/* only change if on singular service post */ | |
if ( is_singular('service') ) { | |
$url = '/services'; | |
$label = 'Services'; | |
/* build new crumb item, index 1 in the array of items */ | |
if ( isset( $crumbs[1] ) ) { | |
$crumbs[1] = \BricksExtras\Helpers::breadcrumb_item($url, $label); | |
} | |
} | |
return $crumbs; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment