Skip to content

Instantly share code, notes, and snippets.

@xlawok
Created April 29, 2022 08:20
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 xlawok/22738b473afec9b7e5f9e6c6f4a098bb to your computer and use it in GitHub Desktop.
Save xlawok/22738b473afec9b7e5f9e6c6f4a098bb to your computer and use it in GitHub Desktop.
navxt breadcrumbs - remove item from breadcrumbs
<?php
add_action('bcn_after_fill', 'pp_navxt_modify_breadcrumbs');
function pp_navxt_modify_breadcrumbs($trail)
{
if(is_tax('kategoria')||is_singular ('produkt' ) )
{
// reverse order of array of breadcrumbs so if I want to remove second item it will be one before last so
// count array and minus 2
$a_leng=count($trail->breadcrumbs);
array_splice($trail->breadcrumbs,$a_leng-2,1);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment