Dont’t change active Button while I’m listing a category?

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?

Related posts

Leave a Reply

1 comment

  1. 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;
    }