I’ve relied on the page-item-ID class to add specific styling to nav items based on custom fields, but it seems that it’s only working once you’re actually on that page in current WP releases.
Seems a bit strange, but I couldn’t find any bug issues around it…
There’s no code as such, it’s whenever I use the wp_nav_menu function to call a menu.
So the menu was set-up in functions using register_nav_menus, then set-up in the admin and attributed to that menu, then called in the front-end.
The “Backward Compatibility with wp_page_menu()” classes are ONLY added to the nav item when you’re on the actual page of that particular nav item.
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Wp_nav_menu page-item-ID and page_item classes’ is closed to new replies.