All you have to do is to change the name of the menu location.
Change the line where it says:
'theme_location' => 'primary',
to
'theme_location' => 'sidebar',
and viceverse.
That should do the trick.
However, you should keep in mind that this kind of setup can become pretty confusing.
(In case you mistake one for the other and start looking at the wrong positions etc.)
Related Posts:
- Multi Level Bootstrap Navigation Menu in WordPress
- Show only 2nd level of navigation depending on active navigation
- HTML Bootstrap navigation menu to WordPress menu using wp_nav_menu
- Custom Nav Walker sub-menu HTML construct
- Adding different classes to anchor in navigation menu
- Add Bootstrap dropdown class to a nav menu
- Nav walker, bootstrap: Display 3rd level items under 2nd level
- how to automatically generate hierarchical menus from hierarchy of pages?
- Make compatible custom menu widget for Twitter Bootstrap
- How to display dynamic content in start_lvl function
- Menus like a CMS
- How to have custom menu Item CSS Classes for wp_page_menu() or wp_list_pages()
- How to add a submenu toggle button inside all “li” elements that have a submenu?
- Main Menu and Sub Menu Items for Footer
- Check if menu id = $specific_id – then insert specific
- How to have two menus using Bootstrap nav walker?
- wp_nav_menu() with multiple Class
- Trying to Create Menu in WordPress
- How do I add recent posts to the menu?
- Automatically list top level menu item child pages
- Check if menu_item has children or has parent
- Add a submenu to wp_nav_menu
- How to buid wordpress menu with auto width sub-menu items in dropdown menu without any items sharing one line [closed]
- Adding toggle-able element after menu item
- Make two bootstrap menus collapse into one dropdown
- How to Add support for sub-menu item description in wordpress?
- Add Different Class on Different Ul in twenty-twentyone theme
- wp_nav_menu container style args
- Bootstrap Theme Migrated to WordPress
- How can I click the parent menu then redirect to a special URL?
- Navbar is hidden behind carousel when using wp-boostrap-navwalker
- Bootstrap Nav Walker Sub Menu Image
- Creating navigation out of specific IDs and their children?
- Where to place a svg chevron down in my custom walker?
- Add href to tag in nav menu for mobile
- Conditional Nav Menu Inside Nav Menu Across Multisite Sites
- Show Child of Parent Page including all other parents
- nav_menu: how to force a subpage switching on the parent menu
- How was this menu system created?
- Display sub menus as separate lists
- nav tag wrapping around dropdown
- Give custom class names to WP nav sub-menu
- Is there an easy way to replace a custom menu link with a page or post?
- Add Javascript to WordPress Menu
- Add custom menu item using wp_nav_menu_items filter
- Add separator to admin submenu
- How show sub menu only using wp_nav_menu()
- How to get a different mobile menu than desktop menu in the twentytwelve child theme
- WordPress Export Import Site Navigation Menu
- Replace menu tag with tag
- How to style current page menu item when using a walker
- BuddyPress – How to add logout in nav menu
- Nav Walker current menu item not displaying
- Navigation (wp_nav_menu) refuses to nest within parent element
- Add custom menu item metabox in Navigation Settings
- Get admin menu link
- Hide Menu Unless Logged In
- Highlight another nav item
- How to change theme header to support multiple nav menus?
- Programmatically add existing pages and subpages to Appearance Menu
- Highlight current post ancestor parent menu items
- walker – 0 level on submenu formatting
- wp_nav_menu() doesn’t work
- Remove nav menu item by script
- Make a navigation menu in the same post [duplicate]
- Get menus created with menu editor?
- Adding sub-menu item makes parent item unclickable
- How to create a menu with pages and post categories?
- remove specific classes from menu items
- Missunderstanding of WordPress menus
- How to add schema.org SiteNavigationElement and property URL to navbar?
- How can I add a delay to the collapsible menu in Twenty Eleven?
- Theme Location empty
- Give Children Unique ID’s
- how to remove description from menu buttons?
- wp_bootstrap_navwalker Fatal Error
- Replace anchor tag with span tag
- If current menu item is child or parent with child?
- How do I add 3rd level of dropdowns to wp_nav_menu array?
- WordPress nav_menu items from another menu appearing
- How to create a mobile menu full screen overlay using Understraps Bootstrap 4 theme
- Unable to remove page from primary menu
- Show navigation header menu by post and categery
- How to Use Default Auto-Generated Menu?
- How to sort a sub-menu, generated with get_pages(), by the page order instead of alphabetically?
- wp-nav menu with custom walker , how to remove a tag if it has any submenu
- Always show wordpress submenu on responsive header menu
- Use menu structure for permalinks
- Add tooltips with image in WordPress Menu?
- Building Menus with the latest posts included
- How to add drop down sub menu from database fields in the particular menu slug
- wordpress superfish dropdown menu
- Unable to edit Navigation bar
- wp_nav_menu changed to wp_page_menu
- Should I custom code drop down menus or use a wordpress plugin?
- Site pages show the page title under navigation bar
- Navigation menu, remove item from desktop
- Wrapping my ‘s with
- Convert a custom bootsrap based menu to wordpress nav walker
- Add acf custom fields so sub item in menus