Hello. Trying to make 3 menus on WordPress, added to functions.php:

add_theme_support('menus'); register_nav_menus( array( 'top' => 'Π’Π΅Ρ€Ρ…Π½Π΅Π΅ мСню', 'bottom1' =>'НиТнСС мСню1', 'bottom2' => 'НиТнСС мСню2' ) ); 

I added my own items to these 3 menus. I registered menus in footer.php and header.php

Example of footer:

  <nav class="nav nav--footer"> <div class="col-md-4"> <?php wp_nav_menu( array( 'menu' => 'bottom1', 'echo' => true, 'items_wrap' => '<ul class="nav__list">%3$s</ul>' ) ); ?> </div> <div class="col-md-4"> <?php wp_nav_menu( array( 'menu' => 'bottom2', 'echo' => true, 'items_wrap' => '<ul class="nav__list">%3$s</ul>' ) ); ?> </div> </nav> 

and on the site I have three identical menus everywhere. That is the top menu everywhere. What am I doing wrong? Tell me

  • If you are given an exhaustive answer, mark it as correct (a daw opposite the selected answer). - Nicolas Chabanovsky ♦

1 answer 1

You have registered 3 areas in this way:

 register_nav_menus( array( 'top' => 'Π’Π΅Ρ€Ρ…Π½Π΅Π΅ мСню', 'bottom1' =>'НиТнСС мСню1', 'bottom2' => 'НиТнСС мСню2' ) ); 

So you need to write if you want to display the established in the registered area menu:

 wp_nav_menu( array( 'theme_location' => 'top', ) ); 

So you can simply display the menu by name:

 wp_nav_menu( array( 'menu' => 'Π’Π΅Ρ€Ρ…Π½Π΅Π΅ мСню', ) ); 
  • I would also send here via this link - pepel_xD