0

I created a menu that includes all the different product categories. Yet the menu displays:

  • Blog
  • Cart
  • Account
  • Shop
  • etc..

It does not display the product categories, just those titles. I have no plugins except for WooCommerce.

The code I used to add the menu is within the functions.php:

    function register_my_menus() {
       register_nav_menus(
       array(  
         'header_navigation' => __( 'nav' )
        )
      );
    } 
    add_action( 'init', 'register_my_menus' );

And in my index.php:

<?php 
wp_nav_menu(array(
    'theme_location' => 'nav', 
    'container' => false, 
    'menu_class' => 'nav', 
));
?>

And through the admin panel I created a menu and called it nav. Then added the product categories.

1 Answer 1

1

You've defined your menu location as header_navigation. Use the menu location slug header_navigation in your call to wp_nav_menu(), not the description (nav):

wp_nav_menu(array(
    'theme_location' => 'header_navigation', 
    'container' => false, 
    'menu_class' => 'nav', 
));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.