Added secondary menu, it replaced the primary
-
Hi!
I’m working with the blank theme. I have the primary menu (made of pages) and need to add the secondary menu on one page. First I registered an additional menu in functions.php. Then I created the secondary menu and assigned it to the secondary display location. Then I went to the specific page (page-{slug}.php) and added the following:<?php wp_nav_menu(array( 'theme-location' => 'additional-menu', 'menu_id' => 'additional-menu', 'menu_class' => 'nav nav-pills mt-3', 'container' => false )); ?>
My header.php contains the following:
<?php wp_nav_menu(array( 'theme-location' => 'primary', 'menu_id' => 'primary-menu', 'menu_class' => 'nav nav-tabs mt-5', 'container' => false )); ?>
The both menus assigned to proper theme locations.
But after I saved the new/secondary menu, the primary menu disappeared from the layout, replaced by the secondary menu.
When I delete the secondary menu, the primary menu returns.
Where is my error?
Thanks!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Added secondary menu, it replaced the primary’ is closed to new replies.