Skip to content

Instantly share code, notes, and snippets.

@wplit
Last active April 25, 2025 03:45
Show Gist options
  • Save wplit/822593b19e74c2e9ea70a1a6f51b1c79 to your computer and use it in GitHub Desktop.
Save wplit/822593b19e74c2e9ea70a1a6f51b1c79 to your computer and use it in GitHub Desktop.
example changing breadcrumb
<?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