Menus Configuration

Configure WordPress navigation menus through the Combo plugin.

Menus Configuration Options

The menus section in your config.yml file registers navigation menus for your theme:

1
menus:
2
main-nav: "Menu principal"
3
footer-nav: "Menu footer"
4
footer-annex: "Annexe footer"

Each menu is defined as a key-value pair:

  • Key: The menu location ID (used in code)
  • Value: The menu name (displayed in the admin)

Using Registered Menus

Once menus are registered, you can use them in your theme with the wp_nav_menu() function:

1
<?php
2
// Display the main navigation menu
3
wp_nav_menu([
4
'theme_location' => 'main-nav',
5
'container' => 'nav',
6
'container_class' => 'main-navigation',
7
'menu_class' => 'menu',
8
]);
9
10
// Display the footer navigation menu
11
wp_nav_menu([
12
'theme_location' => 'footer-nav',
13
'container' => 'nav',
14
'container_class' => 'footer-navigation',
15
'menu_class' => 'menu',
16
]);
17
18
// Display the footer annex menu
19
wp_nav_menu([
20
'theme_location' => 'footer-annex',
21
'container' => 'nav',
22
'container_class' => 'footer-annex-navigation',
23
'menu_class' => 'menu',
24
]);
25
?>

Best Practices

  • Use descriptive names for menu locations
  • Register only the menus you need
  • Use consistent naming conventions for menu locations
  • Choose menu names that make sense to content editors