I want something like this
Home > Products > Steel > Nails
This information should come from the menu structure! I installed Breadcrumb NavXT but it seems that it only takes the path I defined (this is the parent and so on). But I need this from the menu structure not from the user. Do I have to set the parent page for each page or is there a solution which reads out the hierarchy from my menu? I didn’t found a seeting Breadcrumb NavXT and it seems that I have to write a PHP script for that.
Edit:
For my follow up question I added the following code:
if(in_array('current-menu-item', $item->classes)){
$attributes .= ' class="active"';
}
The best way would be to use
wp_nav_menu
with a custom walker.Prerequisites:
Useage
Wherever you want the breadcrumbs (for theme location ‘primary’):
The custom walker
This is very basic. (This could be done another way -override
display_element
instead? – but I found this the most straightforward). This should live in yourfunctions.php