To add that last list item, you don’t need a custom Walker. There is a hook that will allow you to tack that on.
function add_last_nav_item($items) {
return $items .= '<li><a href="#myModal" role="button" data-toggle="modal">Contact</a></li>';
}
add_filter('wp_nav_menu_items','add_last_nav_item');
It wouldn’t be start_el
and end_el
that you’d need to edit anyway. Those generate the individual list items. It isn’t the place to add another item. I think you would probably need to go up to Walker_Nav_Menu
‘s parent Walker
class to get to a place where you can add new items but it isn’t worth the effort just to add items.
Related Posts:
- Multi Level Bootstrap Navigation Menu in WordPress
- How do I add the data-toggle=”modal” data-target=”#myModal” attribures to a WP Nav bar?
- Bootstrap drop down menu with wp_nav_menu
- wordpress nav menu using twitter bootstrap
- HTML Bootstrap navigation menu to WordPress menu using wp_nav_menu
- Output the aria-labelledby parameter for a nav menu child
- Add Bootstrap dropdown class to a nav menu
- Nav walker, bootstrap: Display 3rd level items under 2nd level
- Make compatible custom menu widget for Twitter Bootstrap
- Loop through Navbar, Output Icons
- How can I remove data-target=”#” from bootstrap dropdown menu?
- Make menu bootstrap compatible
- Main Menu and Sub Menu Items for Footer
- How to add class to and childs of sidebar widget – WordPress
- How to have two menus using Bootstrap nav walker?
- Side Menu Icon Expandable
- WordPress Walker – Group two items?
- Sticky Header in WordPress using BootstrapWP theme [closed]
- WordPress + Bootstrap [closed]
- wp_nav_menu not displaying the right way
- Bootstrap button menu on wordpress
- wp_get_archives doesn’t take effect from css or html
- Make two bootstrap menus collapse into one dropdown
- WP nav menu + Bootstrap, add role=”menu” to UL
- Responsive menu on genesis theme [closed]
- Bootstrap menu – make menu entries with submenu not clickable
- Bootstrap Menu bar shows up a toggle in Desktop Mode
- WordPress + Bootstrap: Replace primary navigation menu on mobile?
- Stuck while adding bootstrap navwalker class
- How to use Bootstrap Navbar in wordpress Nav Menu
- Navbar is hidden behind carousel when using wp-boostrap-navwalker
- How to create a mobile menu full screen overlay using Understraps Bootstrap 4 theme
- Bootstrap Nav Walker Sub Menu Image
- Change menu for mobile
- How to change navwalker’s dropdown mark-up?
- Bootstrap navbar responsiveness on WordPress theme menu not working
- My WordPress menu based on Twitter bootstrap creates menu-item and not page-item
- Broken drop down menu using Bootstrap and navwalker class
- nav tag wrapping around dropdown
- Convert a custom bootsrap based menu to wordpress nav walker
- WordPress nav Walker – Bootstrap 5.2.3 – submenu not opening
- Display a portion/ branch of the menu tree using wp_nav_menu()
- Display only page specific sub menu items using Custom Walker
- Pulling Featured Images in to a WordPress Menu
- wp_nav_menu always falls back to a menu
- wp_get_nav_menu_items how to exclude sub level menu items?
- How to drag multiple menu items at once in WordPress?
- Customizing the a tag with Semantic UI
- wp_get_nav_menu_items order doesn’t work
- how to only add a top-level admin menu without it creating a sub-level-menu
- `start_el` depth argument in custom nav walker always evaluates to zero
- WordPress Split Menu
- Custom Admin Menu Order
- How to set classname for tag in wordpress menu?
- Check if menu id = $specific_id – then insert specific
- How to insert link to the default post archive into a menu
- create a 2 row menu in wordpress
- Get menu item by name or slug
- current-menu-item class is not added
- Change sub-menu contents of main menu
- creating a custom walker class
- How to modify wp-includes without messing my wordpress installation?
- Add Buddypress profile and messages link to WordPress menu [closed]
- Use wp_logout_url() in menu creation page
- How to change menu structure?
- Insert a div class inside wordpress menu
- Retrieve Menu name for nav_menu_item
- How to make wordpress nav menu use post custom meta data
- Is it possible to make the heading on a page different text to the text of the menu item?
- How to Structure Pages and Subpages
- Add extra menu to theme
- CTA button that is only visible to some of my users
- add another html tag after li element in wp_nav_menu
- How do I change/remove styling (top border) on main menu for active page and hovering (Avada Theme)
- how to set the link in wordpress such that on clicking it doesn’t open another page but go to the bottom of same page
- custom walker class for own menu?
- Add a menu metabox to post edit page
- Setting or plugin for showing submenus horizontally under the main menu, and keep them after selection
- New wp menu menu styling
- (Mobile) Hamburger menu disappeared from a page (only one)
- Hiding menu on specific pages
- For a menu custom link (without a link) a “#” is appended. Can this just be blank, i.e. NO link?
- sidebar navigation problem with child pages not all display.?
- How to point menu to my homepage
- save_post() on Menu Save
- update_post_meta breaking wp_update_nav_menu_item
- Menu dropdown disapears behind slider
- Generate Submenu based on Parent Page using If Statement
- Building a menu from a large number of pages?
- how to change single post link
- Any simple way to show 10 previous pages by id to current page in links as a menu
- How do I remove a menu from a theme?
- Access CSS Classes specified in Menu options
- How to output the menue structured for tabbed navigation?
- Custom Menu based off custom header
- Adding an additional menu in WordPress
- Making current_page_item work with wp_list_pages in sidebar on post pages
- How to centre menu items on horizontal nav bar? (e.g. make margins equal) [closed]
- One item on menu is not clickable when it should be
- Critical Error when editing menu