Hi,
In the main nav menu by default first level buttons in roots runs like bootstrap panel component; when click over they show second level menu instead of go to its target.
How can I make 1st level menus go to its destiny ON CLICK (page, category, cpt…)
thanks
ben
January 10, 2014, 6:33pm
2
This is default Bootstrap behavior, not Roots. Do some searching for “bootstrap dropdown on hover” and you’ll find several examples to help you out
thanks for the reply,
I did that search and easily can apply a :hover class to a ul to make visible the second level buuuut nothing to do with the src # of the button itself ;(
ben
January 10, 2014, 8:52pm
4
Remove the dropdown toggle code from the nav walker (lib/nav.php
)
<?php
/**
* Cleaner walker for wp_nav_menu()
*
* Walker_Nav_Menu (WordPress default) example output:
* <li id="menu-item-8" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-8"><a href="/">Home</a></li>
* <li id="menu-item-9" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-9"><a href="/sample-page/">Sample Page</a></l
*
* Roots_Nav_Walker example output:
* <li class="menu-home"><a href="/">Home</a></li>
* <li class="menu-sample-page"><a href="/sample-page/">Sample Page</a></li>
*/
class Roots_Nav_Walker extends Walker_Nav_Menu {
function check_current($classes) {
return preg_match('/(current[-_])|active|dropdown/', $classes);
}
function start_lvl(&$output, $depth = 0, $args = array()) {
$output .= "\n<ul class=\"dropdown-menu\">\n";
}
This file has been truncated. show original
yeah!
thanks benword!
if ($item->is_dropdown && ($depth === 0)) {
$item_html = str_replace('<a', '<a class="" data-toggle="" data-target="#"', $item_html);
$item_html = str_replace('</a>', ' <b class="caret"></b></a>', $item_html);
}