Add current-menu-item to items under categories. (2 posts)

  1. haasorensen
    Posted 2 years ago #

    I'm usind WordPress and WooCommerce.
    I've added products under different categories and I'm using:
    <?php wp_nav_menu( array( 'sort_column' => 'menu_order', 'container_class' => 'menu-header' ) ); ?>
    to display a custom menu.

    However, when viewing a single product, the category to where it belongs does not get highlighted.
    Looking at the generated HTML code the CSS class current-menu-item is not added under a single product.

    Is it possible to get this class added?

  2. haasorensen
    Posted 2 years ago #

    By the way, this is the homepage:

    As you see, the category "Postcards" is not highlighted even though the single item is attached the that category.

Topic Closed

This topic has been closed to new replies.

About this Topic