In this article we will teach you how to add menu in footer wordpress. And you can also create menu at any place of your wordpress website.
First of all paste this code in your functions.php file located at website_root_path/wp-content/themes/your_theme/functions.php
register_nav_menus( array( 'secondary' => __( 'Footer Menu', 'generatepress' ), ) );
‘generatepress’ is your theme name and ‘Footer Menu’ is your menu name. You can name it whatever you want and ‘secondary’ is the menu id you can also name it whatever you want.
Now open your wordpress dashboard and navigate to Appearance -> Menus and add your menu items to the Menu you have created.
Now we will show the our menu in wordpress theme let say we want to show menu in footer. Then we will paste the code given below to our footer.php file located at website_root_path/wp-content/themes/your_theme/footer.php
wp_nav_menu( array( 'theme_location' => 'secondary', 'container_class' => 'footer-menu-class' ) );
In the code above ‘secondary’ is the menu id. And we have added in register_nav_menus ‘footer-menu-class’ is the class of our menu container used to styling or adding css to our menu. There are also many options to our function wp_nav_menu.
Thats it you have learned that how to add menu in footer wordpress. And if you want more tutorials and tricks about wordpress then visit our WordPress Page. And follow us on facebook, twitter, tumblr, linkdedin and if you like this article then share this.
Enter Your Comments Here...