If you just want to add the current_page_item
class to one menu item, you could hook up to the nav_menu_css_class
filter, and add that class if needed. It is called when the menu is printed.
If you want access to the whole menu and add classes, hook in to the wp_get_nav_menu_items
filter, where you get the whole $items
array. You can edit the classes
properties of individual items.
Related Posts:
- Dynamically exclude menu items from wp_nav_menu
- Add class to top level menu item if it has multiple child levels
- Add custom attributes to menu items without plugin
- Simple Navigation Walker – Wrapper-class around first sub-menu
- wp_nav_menu, add class to every nth item?
- wp_nav_menu() customized
- child theme automatically adds new page to top menu instead of only custom menu
- Manipulating menu HTML
- Hide pages depending on role
- Add custom SVG icons to Social Icon MENU in WordPress Twenty Seventeen Child Theme
- Add Menu items description via Custom Walker for wp_nav_menu()?
- Wrap description and sub menu in a wrapper
- Navigation menu with children shown only for current page
- How to get the post name (slug) from the item ID when traversing the navbar?
- Why is ‘nav_menu_item_args’ filter’s $item argument empty?
- wp_nav_menu – page template name as item class
- how to get nav menu list through menu name in wordpress
- wp_nav_menu – show children of current menu item only?
- how to assign more permission to wordpress author
- Strange behavor of wp_nav_menu by not appearing [closed]
- Keep parent page active
- Subpages in Menu Editor not Nesting
- $variable (counter) inside wp nav menu
- bootstrap-navwalker will not load
- Where would I find Custom menu attributes in the database?
- How to create a Menu based a username
- How to add php to custom link in the nav menu? [closed]
- Menu / div of year and months of blog posts?
- How to replace the page url for the page slug in a menu link?
- Remove current class from sub menu items
- Getting menu items like get_pages
- How do I render a navigation menu like my theme does?
- Add css class to dropdown
- nav_menu not displaying custom menu
- WordPress Menu Prepends URL To My Anchors
- Automatically list top level menu item child pages
- Check if menu_item has children or has parent
- wp_nav_menu add class to child item with sub child
- How to remove menu installed in wp-admin by a theme? [closed]
- Container class not appearing on navigation menu
- pull non-wp site into content area of wordpress -or- pull wp header into non wp site?
- cross-site custom menu
- How to remove the HOME menu item
- Active Menu Highlighter with Subpages?
- WordPress template – How to add class to li tag if submenu exist
- display menu as table layout
- Wrapping link and .sub-menu with wp_nav_menu
- Bootstrap button menu on wordpress
- Want to add different text after each menu item
- How to create a menu item which is not a page
- How to list only root pages?
- Page menu with one image link instead of page title?
- Is there a way to tell menu items to force non-SSL URLs?
- Search if menu item has child in wp_get_nav_menu_items hook
- Trouble hiding menu on single page
- change hover color of specific menu link [closed]
- How to customize navigation menu in theme which is converted from pure html theme
- enqueue script during add menu items means before save menu items
- WordPress classes removed when using custom walker
- Custom HTML output for registered navigation
- Show subpages of a category in a custom menu
- How to add a menu that belongs to parent blog to all child-blogs?
- How to create this kind of sub-menu in new line?
- How to use wp_list_pages on a grandparent page
- 2 item in a same menu pointing to 1 page
- Dropdown primary navigation menu not working
- Understanding with this WordPress code
- How do I make it so a post only shows in its category archive but not the home page?
- Link after WordPress
- Im having trouble centering menu items in footer due to “flexbox”
- When created sub-directory, can we create a new navbar?
- Is it all right to put the whole tag into template_part file?
- Mobile menu displays submenus on top of parent. Need it to display right below on an own line
- Misleading behaviour on Menu & Theme location
- How to build a menu that change style over a section
- Menu flickering with each refresh on Google Chrome [closed]
- Highlight inner post menu current item
- How i can get current menu id with multiple occurrence
- How to get rid of the bottom line in the navigation menu via CSS file?
- Links in new menu don’t work
- Vertical Menu items shifting to same line when window size increased [closed]
- Menu on responsive twentytwelve theme not working, strange url error
- Installing compact search in the main menu?
- Query for menus in backend (BE)
- Next/previous a-like single navigation
- Add more levels to menu
- How to create a menu super voice in WP?
- WordPress Navigation
- Showing Custom Menus in the sidebar
- How to set up suhosin.ini for unlimited menus
- Somehow lost my MENU from my home page- help!
- How to completely remove the top section with the menu?
- Customizing Responsive Themes Menu [closed]
- How To Conditionally Change Menu In Same Theme Location
- Display sub menus as separate lists
- Add menu to CMS page
- Not even able to Log in [closed]
- how can i get the page_ID in nav li [closed]
- child theme font awesome icons not working
- How to replicate a mobile menu from a site to a wordpress site [closed]