roryashfordbentley/Wordpress-Bem-Menu

How add two or more menu

Closed this issue · 1 comments

How can I add two or more menu if each of them should be an another block with a few changes in html structure?
For example top-nav, top-nav__item ... and footer-nav, footer-nav__item

To add more than one menu you need to first define multiple menus in wp-admin. Then call bem_menu() for each one.

As per your example you could do the following:

<?php bem_menu('menu_location_1', 'top-nav') ?>
<?php bem_menu('menu_location_2', 'footer-nav') ?>

*This will work as long as you have defined both menu locations in wp-admin.

If you wanted to load the same menu data but use different BEM syntax for the top menu and the footer menu you can simply do this:

<?php bem_menu('menu_location_1', 'top-nav') ?>
<?php bem_menu('menu_location_1', 'footer-nav') ?>