Use wp_get_nav_menu_items to iterate through the menu items, modifying the one that you want to in the loop. See the example code here for more information.
Related Posts:
- Adding first / last CSS classes to menus
- Mega Menu Walker
- Displaying Logged-In User Name in WordPress Menu
- how to put the logo in the center of other items in the navigation bar
- renaming an admin menu item with decimal array index number
- How can I hook into and edit the text of a wp_nav_menu tag?
- How to remove a metabox from menu editor page?
- How to show only parents subpages of current page item in vertical menu?
- Hide a menu-item and its submenus and display a ‘Log in’ link if the user is logged out
- The best way to customize “nav-menu-template.php” to add if the ‘link_before’ is “checkbox”
- Can we have a php “page” without a WordPress “page”?
- removing tags from wp_list_pages() using PHP
- wp_delete_auto_drafts() deletes links in menus
- How can I add a class to a single menu item?
- Replacing the NavWalker dropdown element
- How to add specific menu on a specific page or pages
- Unusable menus and “Illegal widget setting ID: nav_menu_item[]” error
- WordPress menu deletes when trying to add a hook
- Logout and redirect using the WP Menu
- Remove all nav menu classes ( but keep useful ones… )
- Second Navigation inside header
- Creating new menu item
- Programmatically create menu with custom link
- Custom Loop through category menu to include sub categories
- selected menu item
- Add itemprop Schema.org Markup to li Elements in wp_nav_menu
- How to display conditional-content if wp_nav_menu( $args ) retruns something
- Can’t extend some core classes
- Show comments menu in dashboard only if the site has comment
- Trouble creating conditional PHP for nav menu items with children for custom Walker
- Count top level menu items
- create a select input with menus created on a custom options page
- Multiple WordPress Menus that will only display all pages
- Menu — How to add “current-menu-grand-ancestor” css class
- Hide Hamburger Menu On Specific Page (Front Page/Home Page)
- Menu Limitations
- Add data attribute to each li in menu
- Remove metabox from WordPress menu editor page?
- Custom Walker_Nav_Menu issue with variables on PHP 7.3
- How to add an arrow to menu items has submenus
- wp_nav_menu returns menu list in ascending order. How can I arrange the menu same as dashboard menu
- Unique icons next to each WordPress menu item
- Secondary navigation menu on one page
- Remove class in nav_menu_link_attibutes filter
- WordPress Quick Question . How to Get Parent Link in Submenu in My Code
- Detecting classes, adding widgets, and adding divs in with a Nav Walker
- Custom Menus: dynamic highlighting problem with custom home link
- Add item to top of menu using a filter in functions.php
- Adding PHP in the menu
- How to style one item from main navigation?
- New walker for walker_nav_menu to change inside container data
- Add data-id attribute to child page links
- Automatically add images to a menu
- Menu Custom Data Attributes
- Notice: Trying to get property of non-object
- How to modify mobile nav menu text in theme
- How can I use custom menus with a Bootstrap WordPress theme?
- Nav menu from plugin to theme
- Adding Additional Variables on Menus Page
- Nav-Menu not showing up
- Custom navigation menu with awsAccordion
- Why in this WordPress theme I can’t see the Main Menu?
- wp nav menu: show submenu below li item
- Dynamic Menu drops pages?
- Class for Selected Menu using wp_nav_menu
- Styling an “active” link outside of WordPress default menu
- How to create Loop code for Menu using WordPress?
- Hard-coding a shortcode as the last menu item in primary navigation?
- Add class to ul and li in wp_na
- Nav Walker that shows only children and siblings of top level parent menu item
- how to changes mobile menu toggle breakpoint in WordPress
- How to display already created menus via php?
- Featured image in menu wordpres
- How to set Nav as a default menu in wordpress
- How to let mobile navigation menu close when link is clicked?
- Get Child of Child Pages in custom Menu
- PHP warning with code for nav menu walker [duplicate]
- Add element after navigation element title don’t works like I expect
- How to disable sub menu items from being created?
- String replace for Login/Logout concatenation problem in menu
- Bring Font Awesome icons inside menu A tags
- How to create a sub-page of sub-page?
- Display specific main Sub Nav on Woocommerce product pages
- PHP drop down menu for my get_category child of
- Widget Logic – display on page and all child
- Adding button to wordpress menu
- Editing existing pre-created menus in PHP
- How I can add div to menu?
- wp_nav_menu prints children with parent name
- WP Admin Bar – Get current theme name as custom menu title
- Active class not working on custom menu link using add_menu_page
- Using ‘array’ method in wp_nav_menu causes it to disappear
- How to get the count for each taxonomy term
- Custom Links in Walker Class
- Submenu opened problem
- WordPress menu links with images & class selection
- Open WordPress Page from selected option dropdown
- Remove Unused Menu Locations
- How to add different menu items on different menus?
- Nav menù doesn’t display selected pages