Here are a couple things I noticed.
You don’t want to include the <a>
inside of link_before
or link_after
, you will get 2 links if you do that. You also don’t need the <ul>
. Instead I think you want something like this…
<?php
wp_nav_menu(array(
'theme_location' => 'primary',
'before' => '<class="nav-item active">',
'menu_class' =>'navbar-nav mr-auto',
'link_before' =>'<span class="nav-link">',
'link_after' =>'</span>',
'container' => false,
'items_wrap' => '%3$s'
));
?>
You should read more about wp_nav_menu.
Related Posts:
- How to add or remove borders in navigation menu?
- Adding an Arbitrary Link to the Admin Menu?
- Split up wp_nav_menu with custom walker
- How to Add to Each Menu Link with link text to data-attr?
- Add custom classes to anchor in wp_nav_menu
- Removing link ” from ” menu for some “links” without JS
- Determine if a navigation item has children
- Bootstrap dropdown nav pills not working with wp_nav_menu()
- How to move parent li to end of child ul
- Show menu item description with line breaks
- Remove/Disable “Automatically add new top-level pages to this menu”
- Links open only on new tab or window
- Bar separated navigation by extending Walker_Page
- How to Create a Custom WordPress Navigation Menu with the Code?
- Custom Nav Walker sub-menu HTML construct
- Add class to menu ul with active child
- Make compatible custom menu widget for Twitter Bootstrap
- Does WordPress create mobile menus automatically?
- How to display dynamic content in start_lvl function
- Add custom text to menu
- Menu styling for last menu item
- Disable automatig SVG tag from menu
- Menus like a CMS
- Replace menu permalink/hyperlink with only menu name/slug
- wp_nav_menu add some element to container
- Use wp_nav_menu to display ALL pages
- Third level navigation class
- get_query_var(‘post_type’) not returning in a filter
- Find out if a page has no parent
- Prev / Next menu item
- Navigation Menus Depth for specific menus
- wp_nav_menu() with multiple Class
- add span class and i tag inside wp_nav_menu link anchor tag
- Can’t include Language switch in Nav Menu
- Add within the output of
- Grey out nav buttons unless is_user_logged_in()
- How to approach this menu design?
- Trying to Create Menu in WordPress
- Reuse a custom WordPress menu on another WordPress website
- How to dynamically populate a dropdown
- Is this format possible with a custom Nav Walker class?
- two different separate sections on the same site
- Cant add menu items with my theme
- How do you add a around the second level of a Menu?
- How should I build a custom menu walker for this setup?
- How can I add text to a single nav menu item?
- Alternative to wp_get_nav_menu_items?
- Using my WordPress menu on another platform
- How Do I Add Images To Main Navigation Menu
- Add a submenu to wp_nav_menu
- Walker menu not displaying at all
- Hide menu from homepage
- remove menu items if user can’t read
- How to automatically redirect to first item of second navigation level in a multi-level menu?
- How to hide the menu item created by the theme in WordPress admin panel?
- Locking in navigation labels before changing title?
- How to add columns to wordpress menu editor
- how to insert data in li tag of navigation
- How to Add support for sub-menu item description in wordpress?
- Current author archive in navigation menu
- Output Post ID for all nav_items
- Custom ul class
- Removing Submenu from Menu
- How to create menu spread over four lines including images
- Efficient wp mobile menu
- Additional navigation bar in header
- Help with WordPress Custom Nav Walker
- Why is my navigation in my onepage not working?
- Navigation item – current date in url
- Hide a menu (navigation bar) on all posts
- Does the Default theme of WordPress like 2016, 2017 and 2019 uses Walker_Nav_Menu Class
- Bootstrap Nav Walker Sub Menu Image
- Menu doesn’t open on mobile
- Creating navigation out of specific IDs and their children?
- I can´t make the menu unclickable in an easy way
- Add active class to wp_nav_menu
- Disable Top Nav Bar on Mobile
- Making my main menu a hamburger menu on all platforms
- menu change after theme change
- how to configure this type of menu
- menu mobile show up even i in desktop mode in Newspaper Theme
- Header lists posts instead of showing primary nav menu
- Programmatically add a Navigation menu and menu items
- Site-wide tabs at WordPress website?
- Creating custom Menu for custom theme
- How to add class and span to
- Show Child of Parent Page including all other parents
- Show only second level menu items? [duplicate]
- Add item ONLY to the primairy navigation
- wp_nav_menu in 3.7 add name class nav navbar-nav
- Image menu on responsive WordPress
- wp_nav_menu: indicate by id page grandparents
- individual images as navigation design TwentyTen
- WordPress Navigation default output
- How to get wordpress navigation to work
- How do I show a different secondary navigation menu for each section of my website?
- Add a navigation menu item using MySQL
- how to make a walker to this (in bootstrap, i try but not work)
- Site navigation sits unstyled for a second on page reload [closed]
- Custom navigation / menu output (walker?)