Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Manually fix Breadcrumb NavXT breadcrumbs for pages on Search & Filter pages
/**
* Fix Breadcrumb NavXT breadcrumbs for pages on Search & Filter pages
*/
add_action('bcn_after_fill', 'kmw_navxt_filter_breadcrumb_fix');
function kmw_navxt_filter_breadcrumb_fix($trail)
{
$query_var = get_query_var( 'sfid' );
if( !empty( $query_var ) ) {
array_pop($trail->trail);
array_pop($trail->trail);
$trail->add(new bcn_breadcrumb('NAME OF PAGE', NULL, array('home'), get_permalink(##)));
$trail->add(new bcn_breadcrumb('NAME OF SITE', NULL, array('home'), get_home_url() ));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.