0

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.

1 Answer 1

2

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?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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