0

I would like to have a level 1 menu in a vertical menu and a full menu in a vertical menu in the left sidebar in Twenty Eleven. My problem is that I would like to make the top item bold if the user is in it, or in one of it's child menues.

The ideal solution would be to apply a rule for .current_page_ancestor. But for my biggest surprise, that rule IS already in the original css file for Twenty Eleven. But it seems to be broken, as nothing happens!

#access .current_page_item > a,
#access .current_page_ancestor > a {
    font-weight: bold;
}

Do you know how to fix this? Is there a ticket for this bug already?

To have an idea, have a look at this site, I made the selector red to make it visible. What I would like to achieve is that the top menu stays red even if I'm in one of the child menus on the left.

sample page

1

Try adding the .current-page-ancestor selector to your style, note the use of hyphens instead of underscores.

| improve this answer | |
  • Oh, I missed that. So did the developers of WP. I'll start a Ticket. Thanks – hyperknot Sep 23 '11 at 12:12
  • No problem. Im not sure, but there may be a reason theres a class that uses underscores and another that uses hyphens. – Jono Warren Sep 23 '11 at 12:17
  • There is one now: core.trac.wordpress.org/ticket/18756 – hyperknot Sep 23 '11 at 12:18
  • For the reason, I found a ticket, it's actually for backwards compatibility. But the CSS should be modified. – hyperknot Sep 23 '11 at 12:22
  • Ahh, I thought it would be something like that. Which is the preferred selector now? – Jono Warren Sep 23 '11 at 12:29

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.