Merge two separate WP menus into one in Mobile view

I had the same problem. The solution I chose was to “merge” the menus by placing them under a single div wrapper but have them on separate div class. Something like this: <div class=”menu-wrapper”> <div class=”menu1″> <?php wp_nav_menu( array( ‘theme_location’ => ‘menu-1’, ‘menu_id’ => ‘top-menu’, ) ); ?> </div> <div class=”menu2″> <?php wp_nav_menu( array( ‘theme_location’ … Read more

Show link to add menu

Its possible: if (has_nav_menu(‘topheader’)) { // User has assigned menu to this location; // output it wp_nav_menu(array( ‘theme_location’ => ‘topheader’, ‘menu_class’ => ‘topMenu’, /* bootstrap ul */ ‘walker’ => new My_Walker_Nav_Menu(), /* changes to a bootstrap class */ ‘items_wrap’ => ‘<ul id=”%1$s” class=”%2$s”>%3$s</ul>’, ‘menu_id’ => ‘topMenu’ )); }else{ if (is_user_logged_in()) { //we check if the … Read more

Remove current_page_parent from posts page link in WordPress nav menu

I assuming you’re using wp_page_menu() or wp_list_pages(). If so, then what you need to do is hook into the page_css_class filter, e.g., add_filter (‘page_css_class’, ‘my_func’, 10, 5) ; function my_func ($classes, $page, $depth, $args, $current_page_id) { if (/* test condition */) { $classes = array_diff ($classes, array (‘current_page_parent’)) ; } return ($classses) ; } where … Read more

Popup Maker nav menu item not working

You can use something like this, add_filter( ‘wp_nav_menu_items’, ‘your_custom_menu_item’, 10, 2 ); function your_custom_menu_item ( $items, $args ) { if ( $args->theme_location == ‘Primary’ ) { // change the menu location if not Primary $items .= ‘<a class=”request-maintenance-open” href=”#contact_form_pop”>Request Maintenance</a>’; } return $items; }

WordPress menu deletes when trying to add a hook

I don’t think there’s wp_nav_menu action. Perhaps you want the wp_nav_menu filter (doc)? function custom_novice_menu($args) { if( ‘primary’ == $args[‘theme_location’] ) // only apply to the right menu { $args[‘container’] = ‘div’; } return $args; } add_filter(‘wp_nav_menu’, ‘custom_novice_menu’);

Walker_Nav_Menu: Items not nested correctly

You have this problem, because of your code 😉 function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { $ident = str_repeat( “\t”, $depth ); if ( $args->walker->has_children ) { $classes=”menu-item-has-children menu-item menu-item-” . $item->ID; // actual link // you SHOULDN’T close the li tag in here $output .= “$ident<li … Read more

WordPress wp_nav_menu with a nav tag

You were really close. There is container argument for wp_nav_menu: ‘container’ (string) Whether to wrap the ul, and what to wrap it with. Default ‘div’. Its default value is ‘div’, which means, that the ul will be wrapped with div tag. You can change it to false – ul won’t get wrapped at all in … Read more