Hi,
I’ve been searching around for a solution but I couldn’t quite find it. So when I make a menu item with a drop down, the top level item is not clickable. It produced the ‘#’ link, though I solved it with correct link, but it is still not clickable.
Similar issue is described in this topic: https://colorlibsupport.com/t/top-level-header-item-is-not-linking-to-a-page/
But i tried all those things, but it didn’t quite work…
Here’s my live site: http://odpravauganda2017.org/
And here’s part of my navwalker.php code
// If item has_children add atts to a.
if ( $args->has_children && $depth === 0 ) {
$atts['href'] = ! empty( $item->url ) ? $item->url : '';
$atts['data-toggle'] = 'dropdown';
$atts['data-hover'] = 'dropdown';
$atts['class'] = 'dropdown-toggle';
$atts['aria-haspopup'] = 'true';
//$atts['data-toggle'] = 'dropdown'; <- gets added in jQuery file on < 768 window
} else {
$atts['href'] = ! empty( $item->url ) ? $item->url : '';
}
Also I want when in the page of the sub menu item, I want that the top level menu is under active link. So in my case this would be yellow.
How can I do this? Please a step by step help with codes would be really appreciated.
Thanks in advance