Wordpress adds .current-menu-item class to menu items linked to page sections on home page
Briefly

The issue arises because, on WordPress, the .current-menu-item class is being added to all three menu items: About, Services, and Home whenever any of those pages are accessed. This occurs because they point to the same base URL, causing the class to trigger for all. To resolve this, a more specific conditional logic needs to be implemented in the add_menu_item_classes function, ensuring that only the menu item associated with the currently viewed section receives the active class, thus preventing confusion and maintaining a clear navigation experience for users.
Your current filter implementation adds the same .current-menu-item class to all three menu items whenever you're on any singular page, including 'home', 'about', or 'services'. This means that if you're on any subpage, all three items appear active, which isn't desirable.
To correctly achieve unique menu highlighting, you need to conditionally check if you're on a specific page, rather than relying solely on is_singular(), which applies broadly.
Read at SitePoint Forums | Web Development & Design Community
[
|
]