WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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