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.

The navigation menu of my site is generated via

wp_nav_menu( array( 'theme_location' => 'primary') );

Some menu entries are category pages (say /category/news/). This page contains links to the next level, single post posts (say /news/123/).

I noticed that the menu is only highlighted ('current-menu-item' class) when the category page is the current. How can I make the menu stay highlighted when viewing single post pages (/news/123/)?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

You can target the .current-menu-parent class in your CSS to keep the category highlighted when viewing single posts.

share|improve this answer
    
Thank you for your help. –  He Shiming Apr 28 '13 at 12:13

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.