Created
October 6, 2013 08:32
-
-
Save hissy/6851195 to your computer and use it in GitHub Desktop.
[WordPress/Breadcrumbs NavXT] How to change template of specific breadcrumbs item
This file contains 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 | |
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'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
default template:
<a title="Go to %ftitle%." href="%link%" class="%type%">%htitle%</a>