How to switch between the Primary Menus programmatically?

you can do it on the clientside, if you output both menus and change the visibility on the click of the button via javascript.

if you want to do this on the serverside, you could make another template or a if to output the menu you want to show to the user.

the only thing you have to change here is the $args in calling wp_nav_menu( $args);

Leave a Comment