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 a page that is not linked in my custom menu. This page has a parent page, which is linked in the custom menu.

If I go to the "not-linked" page, I want to to highlight it's parent page link in the menu.

I use WordPress 3.0 and there is a possibility to create a custom menu (drag-and-drop - Appearance > Menus).

The custom menu uses a list for menu styling and I would like to add a class to the parent Page link within the <li>. I also have pages with two, and top level parents.

share|improve this question

WordPress already applies the CSS class current-page-ancestor to the <li> if it is a link to a Page that is a parent (or higher) of the current Page. This follows the Page structure, not the menu structure. If this is not fit for your situation, could you edit your question to make it more clear how it differs?

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.