Not swapping menu created on archive page
-
I’ve tested my conditional settings on standard menus and the plugin works fine on pre-existing locations.
However I want to create a conditional menu on an archive page which did not have a pre-defined menu location. In my functions.php file I have registered a new menu. I have created a new menu location and added the menu, which works. I used this code:
add_action( 'woocommerce_before_main_content', 'artwork_categories_menu' ); function artwork_categories_menu() { wp_nav_menu( array( 'menu' => 'artwork_categories', 'container_id' => 'artwork_categories_menu_container' ) ); }
This ‘hard-coded’ menu is not changed by conditional rules. I have tried an alternative method of creating a menu location (without hard-coding a menu into it) but it does not show up in my WordPress list of menu locations.
Am I going about it all wrong…?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Not swapping menu created on archive page’ is closed to new replies.