Skip to content

Instantly share code, notes, and snippets.

@hissy
Created October 6, 2013 08:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hissy/6851195 to your computer and use it in GitHub Desktop.
Save hissy/6851195 to your computer and use it in GitHub Desktop.
[WordPress/Breadcrumbs NavXT] How to change template of specific breadcrumbs item
<?php
function my_filter_breadcrumbs($bcnObj) {
if ( count($bcnObj->trail) > 0 ) {
for ( $i = 0; $i < count($bcnObj->trail); $i++ ) {
if ( '暁美ほむら' == $bcnObj->trail[$i]->get_title() ) {
$bcnObj->trail[$i]->set_template('%htitle% …君は…一体…');
}
}
}
return $bcnObj;
}
add_action('bcn_after_fill', 'my_filter_breadcrumbs');
@hissy
Copy link
Author

hissy commented Oct 6, 2013

default template: <a title="Go to %ftitle%." href="%link%" class="%type%">%htitle%</a>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment