Ready to get started?Download WordPress


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

  1. haasorensen
    Posted 6 months 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 6 months 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.


You must log in to post.

About this Topic