How to make link to different categories that in them selves loads different menus?

Im kinda a noob but have made some homepages for fun but got this new one that im making for a friend that´s stopped my dead in my tracks:

http://yellowknife.se/artfex/

Read More

The popup (ugly as hell and will be changed into images) gives the visitor the option of three different types of products to view. I need help with how to make a custom menu load when each of these three categories are clicked. I´ve googled but didnt get to far, to little codeexperience keeps me from getting it.

Anyone got any thoughts?

Thanks!
Dave
Sweden

Related posts

Leave a Reply

1 comment

  1. Once the category is selected it would be pretty easy with the help of wp_nav_menu to check what category is currently selected using is_category and then load the menu you need. This would be defined in your page template or header (depending on where your menu is loaded)

    if (is_category('category 1')) { 
        wp_nav_menu( array('menu' => 'category1-nav') );
    } else if (is_category('category 2')) { 
        wp_nav_menu( array('menu' => 'category2-nav') );
    } else if (is_category('category 3')) { 
        wp_nav_menu( array('menu' => 'category3-nav') );
    }
    

    You will need to define the different menu’s in your functions.php like this :

    register_nav_menus( array(
    'category1-nav' => 'Category 1 Navigation', 
    'category2-nav' => 'Category 2 Navigation',
    'category1-nav' => 'Category 1 Navigation'
    ) );
    

    Once you’ve defined the menu’s you can set them up under Appearance > Menu’s in the admin area.