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'm customizing a WordPress theme for my school, and I'm a bit annoyed by the fact that the current page in the nav menu is not indicated.

For example:

enter image description here

You can clearly see that I'm hovering over a page in the nav menu, and that the page I'm hovering over is highlighted, as expected.

However, the page that I'm currently on, called "Arhiva", is not highlighted, and I think that this can be somewhat confusing.

I don't want the current page and the page the mouse is hovering over to be highlighed in the same manner though. I believe that a bold entry text in the nav menu would do just fine to separate the current page from other pages.

How can I achieve this?

Theme's current CSS can be viewed here: http://petagimnazija.hr/wp/wp-content/themes/chiron/style.css.

share|improve this question
    
Does it not work at all or for specific page(s)? Meaning is it broken or not implemented in first place in your theme? –  Rarst May 4 '13 at 20:04
    
I'm pretty sure it's not implemented in the theme. But it should be trivial if WordPress provides the appropriate classes to me, right? (Please don't tell me it doesn't.) –  jco May 4 '13 at 20:17
    
Well, had you looked for them?.. :) Your site seems to be using custom menus and they seem to have appropriate classes like current-menu-item fine... –  Rarst May 4 '13 at 20:25
    
That's what I was looking for, thanks @Rarst. If you'd put that in an answer, I'd be glad to accept it. I just forgot to look for those classes... SE makes you dumber in some cases :/ –  jco May 4 '13 at 20:42
add comment

1 Answer 1

up vote 3 down vote accepted

The Navigation Menus system is adding a lot of classes, including matching current page (rather intelligently, it will even try to detect custom URLs, that were input explicitly).

The simplest class to make use of is current-menu-item, but there are quite a few more dealing with parents/ancestors and more.

Codex has them documented at wp_nav_menu() > Menu Item CSS Classes.

share|improve this answer
add 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.