Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

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

share|improve this answer
    
Oh, I missed that. So did the developers of WP. I'll start a Ticket. Thanks –  zsero 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 –  zsero 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. –  zsero 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
show 1 more comment

Your Answer

 
discard

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.