W3 Mind Logo
Home » How to add secondary menu into a WordPress template

How to add secondary menu into a WordPress template

Add the below function to create a new menu in functions.php and register it:


register_nav_menu( 'primary', __( 'Primary Menu', 'yourtheme' ) );
register_nav_menu( 'secondary', __( 'Secondary Menu', 'yourtheme' ) );

This brought up a 2nd menu in the Theme Menu options.

Now add the below code to the desired place on your theme file. In this case, it would be added to the footer.


<?php wp_nav_menu( array('container_class' => 'footer-menu', 'theme_location' => 'secondary') ); ?>

About Author
Picture of W3Mind

W3Mind

W3Mind focuses on Blogging, Make Money Online, SEO, Business Blogging, Social Media, WordPress, Internet Tools, Web Design and Development.
Give it a Share
Facebook
Twitter
LinkedIn
You May Also Like
How to
START A
BLOG
(step by step)
Load WordPress Sites in as fast as 37ms!