I have my menu made of images. Therefore I use divs and with .current-menu-item I use CSS to change the image. This works if I'm directly on this main page. If I'm on a subpage I cannot use this trick anymore. The reason is that the submenu is build like the following:

Each page has set a parent. The submenu is generated with

    'child_of' => SUBMENU_ROOT

whereas SUBMENU_ROOT is the fetched top most parent. So I have the parent ID which should be highlighted in the main menu. How can I achieve a highlighting of the main menu when I'm on a subpage?

Or is the only way to use the normal menu dialog?


You could use .current-menu-parent and/or .current-menu-ancestor.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.