I ran into similar problem when I created a bootstrap navigation menu and dropdown links were all showing up at once.
I used the following steps to correct the issue:
-
download navwalker from github repo link: https://github.com/wp-bootstrap/wp-bootstrap-navwalker
-
put this file in the root folder of the theme and in the functions.php file
userequire_once get_template_directory() . '/wp-bootstrap-navwalker.php';
-
finally you’ll have to add following parameters:
$defaults = array( 'container' => false, 'theme_location' => 'primary-menu', 'menu_class' => 'nav navbar-nav navbar-right', 'fallback_cb' => 'WP_Bootstrap_Navwalker::fallback', 'walker' => new WP_Bootstrap_Navwalker(), ); wp_nav_menu($defaults);
especially last two parameters to your wp_nav_menu()
function.
I hope it helps
Related Posts:
- How to Create a Custom WordPress Navigation Menu with the Code?
- How to remove dropdown from wp_nav_menu
- How can I create this menu with wp_nav_menu()?
- wp_dropdown_nav function to list menu items
- Is there an easy way to replace a custom menu link with a page or post?
- Add Javascript to WordPress Menu
- Filter wp_nav_menu()
- Show just one level of child pages, wp_list_pages woe
- Use navigation path from menu for permalink
- add span class inside wp_nav_menu link anchor tag
- How to set limit only on top levels of wp_nav_menu?
- Show only 2nd level of navigation depending on active navigation
- How to move parent li to end of child ul
- Show child pages by menu order using Superfish Dropdown menu?
- How to manually add an item to a submenu in a menu generated by wp_nav_menu?
- Using Image Links in WordPress Navigation Menus Instead Of Text Links
- Disguise Multi-Page site as Single Page
- Custom Nav Walker sub-menu HTML construct
- Adding different classes to anchor in navigation menu
- Add Bootstrap dropdown class to a nav menu
- Search box as a menu item in the nav menu output by wp_nav_menu?
- Add class to menu ul with active child
- How can I put two menus in the same div?
- Second nav is merged with the first in mobile
- How to display dynamic content in start_lvl function
- Using Shortcodes in WP-Menus in WP 3.1 (via nav_menu_objects)?
- Disable automatig SVG tag from menu
- Replace menu permalink/hyperlink with only menu name/slug
- wp_nav_menu add some element to container
- Auto add pages to primary menu with functions.php
- Find out if a page has no parent
- how to remove the top navigation bar or header top on wordpress website?
- Can’t include Language switch in Nav Menu
- Add within the output of
- how can i add css class on current page in wordpress wp_nav_menu
- How to rewrite the output of wordpress nav menu?
- Reuse a custom WordPress menu on another WordPress website
- How to dynamically populate a dropdown
- I want to hide the navigation menu on a particular page
- two different separate sections on the same site
- Static page to one page- menu inactive items highlighted
- automatically append menu parent as first item in submenu with nav_walker
- How do you add a around the second level of a Menu?
- Help with walker for nav
- Hide menu from homepage
- Adding toggle-able element after menu item
- Add custom link on the fly to nav menu
- Custom register_taxonomy ins’t showing custom Nav menu
- Conditional menus based on page title
- How to test if a specific page is the front page?
- Style wp_link_pages as a select drop down list
- How to add columns to wordpress menu editor
- how to insert data in li tag of navigation
- Current author archive in navigation menu
- Mobile navigation is shown, but standard navigation does not disappear
- Output Post ID for all nav_items
- changing the labels inside appearance -> menus for some for the fields
- dropdown menu, with walker
- How to create menu spread over four lines including images
- WP Menu Rollover Nav Item and Effect DIV Elsewhere
- Help with WordPress Custom Nav Walker
- How to change the navigation menu
- Add/remove image from navigation bar
- WordPress nav_menu items from another menu appearing
- How can I order these pages in this navigation bar on this old wordpress theme?
- WordPress Menu Navigation links not working
- Where to place a svg chevron down in my custom walker?
- How to apply individual menu item’s “CSS Classes” to , not ?
- Add href to tag in nav menu for mobile
- Output existing wp_nav_menu with a custom walker
- Sub-Items Not Visible in Navigation
- Unable to remove page from primary menu
- Foundation Scripts not loading (custom theme)
- Show navigation header menu by post and categery
- How to Use Default Auto-Generated Menu?
- wp-nav menu with custom walker , how to remove a tag if it has any submenu
- Menu Details Output in Javascript [closed]
- Custom location for menu
- No indication of menu
- nav_menu: how to force a subpage switching on the parent menu
- wp_nav_menu() reutrns HTTPS?
- How to make a drop down menu with categories
- Determine if a navigation item has children
- wordpress superfish dropdown menu
- Unable to edit Navigation bar
- Display Username as parent menu item
- How to add or remove borders in navigation menu?
- Should I custom code drop down menus or use a wordpress plugin?
- Site pages show the page title under navigation bar
- Keeping my Sub Menu open when hovering on its list items
- Navigation menu, remove item from desktop
- Jquery dropdown menus working locally, but not in WordPress [duplicate]
- Wrapping my ‘s with
- What is the best way to incorporate responsive dropdown navigation menu into custom theme?
- How to add a class directly on a unordered list element that is a primary navigation
- How do I programatically remove Menus?
- Displaying a Custom Avatar in WP Bootstrap Navwalker Menus in WordPress
- Icon not shown in Dropdown menus in Twenty Seventeen Theme
- Is there a way to make it so that I don’t get a hamburger menu, but rather a desktop style nav, when resizing to a mobile size
- Give custom class names to WP nav sub-menu