Highlight "Blog" menu when accessing a category or post

0

I have a wordpress website and I would like that as soon as the menu is selected according to the page that I am, I also select the "Blog" menu item when I am on a category page or post.

This is the menu code for my theme:

$defaults = array(
    'container'         => 'nav',
    'theme_location'    => 'primary',
    'depth'             => 3,
    'walker'            => new ts_walker_nav_menu
    );
wp_nav_menu( $defaults ); ?>
    
asked by anonymous 23.03.2016 / 21:42

1 answer

0

By default wordpress places the class ".current-menu-item" in the item that is selected in the menu, try styling this class in your css.

But if I understood the question well, you need the "blog" menu to also be highlighted, you will need a test, because the nav function will not automatically identify that the blog is active, since it will return the category as an asset.

    
12.04.2016 / 16:10