New answers tagged

0

I sort of added onto @Giri's answer by using array_map and array_count_values. if this helps anyone in the future. I didn't wish to use a counter and a foreach loop for something so simple. function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { if ($item->hasChildren) { $locations = get_nav_menu_locations(); // ...


-1

Use following code as jQuery: jQuery('#nav li').removeClass('current'); jQuery('#nav>li.current-menu-item').addClass('current'); jQuery('.has-children li.current-menu-item').closest('.has-children').addClass('current'); See jsfiddle (current item red color). When you click "Single Blog" menu item your html structure will like my following example and ...



Top 50 recent answers are included