Since WordPress 3.0, there has never been easier to create and edit navigation menus . This feature is nevertheless complicated to use if your theme does not support the location of menus.
In this tutorial, we will see how to define a site of custom navigation menu.
In other words, it will be possible to indicate directly from the module and Appearance menu, where it will be displayed by selecting one of the sites we have specified.
---
Step 1 – Modify the file functions.php
Note: Be careful not to duplicate this feature if your theme supports this functionality natively. Therefore made a preliminary search using the Find command of your browser.
As often, we need to edit the functions.php file in the folder / wp-content/themes/Your_Theme_name/functions.php accessible via an FTP client.
You can also go through the module and then Appearance Editor to Menu.
End of file, add the following lines of code:
<? Php
add_action (‘init’, ‘register_my_menus’);
register_my_menus function () {
register_nav_menus (
array (‘top-navigation’ => __ (‘Top’), ‘footer-menu’ => __ (‘Footer’))
);
}
?>
This snippet will create the effect of two locations for your theme and menu to initialize the function menu creations.
Step 2 – Changing Your WordPress Theme
Obviously, this technique presumes to have inserted into your theme, the function that will display the menu in question.
<? Wp_nav_menu php (array (‘theme_location’ => ‘Top’));?>
This command will then display the Top Menu you can create / modify from the WordPress admin. A generally insert into the header.php file.
Step 3 – Select the location of menus
Then return to Appearance then Menus. Note the appearance of a new box containing the parameters under locations. A drop down list you can then select the menu display:

You are now able to define the locations of navigation menus in your WordPress theme. Convenient, right?
