WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a simple Navigation: Blog, About, Contact. Mainsite is Blog. To keep the current Button highlighted, I used this in my CSS:

    li.current_page_item a{
   border-bottom: 1px solid #212121;
    padding-bottom: 1px; 

It works pretty fine. But I want to keep Blog still active while I’m listing an item from my categories. What is the best way to do this?

share|improve this question
I guess you're willig to keep the button home active also on the category archive page. – amit Aug 13 '12 at 13:02
Yes, but how can I do this in a simple way? – Nitzki Aug 13 '12 at 13:05
up vote 2 down vote accepted

Okay, I did it this way::

add_filter('nav_menu_css_class' , 'special_nav_class' , 10 , 2);
function special_nav_class($classes, $item){
     if(is_category() && $item->title == "Blog"){ //Notice you can change the conditional from is_single() and $item->title
             $classes[] = "special-class";
     return $classes;
share|improve this answer

Your Answer


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.