WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. haasorensen
    Member
    Posted 5 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
    Member
    Posted 5 months ago #

    By the way, this is the homepage:
    http://udkast.danishsouvenir.com/product/postcard-finn-055/

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

Reply

You must log in to post.

About this Topic