All menu items are "current" on home page???
-
Hi,
My wordpress site was recently moved to a new server, and one of the issues that cropped up was, all menu items are attributed the “current-menu-item” class.
This only occurs on the homepage, where no menu items should have the current style.
I have spoken to our system administrator and assures me, nothing has changed.
I’m running the latest version of wordpress, using UberMenu and a host of other plugins. I have tried deactivating, and activating, and even deleting all other plugins and trying again.
When the links are removed on the menu items then the problem disappears, but it’s a useless fix as we obviously need the links.
This is some code I modifyed, which we used to use to change the “current” class to active, but I’ve just removed the active, so nothing is printed, I was hoping with an if statement around it, it would work only for the home page, but that doesn’t seem to be the case.
if(is_home) { function current_to_active($text){ $replace = array( //List of menu item classes that should be changed to "active" 'current_page_item' => '', 'current_page_parent' => '', 'current_page_ancestor' => '', ); $text = str_replace(array_keys($replace), $replace, $text); return $text; } add_filter ('wp_nav_menu','current_to_active'); }
If anyone has any ideas, I would appreciate the help, as I am completely stuck.
Thanks in advance!
John
- The topic ‘All menu items are "current" on home page???’ is closed to new replies.