Created
April 29, 2022 08:20
-
-
Save xlawok/22738b473afec9b7e5f9e6c6f4a098bb to your computer and use it in GitHub Desktop.
navxt breadcrumbs - remove item from breadcrumbs
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 | |
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