How to register Navigation Menu in WordPress Function


1).  FUNCTIONS.PHP – MENUS

// Register menus

if ( function_exists( 'register_nav_menus' ) ) {
    register_nav_menus( array(
        'primary' => __( 'Primary Navigation' ),
        'secondary' => __( 'Secondary Navigation' )
    ));
}
To display menus on the front end, you would place the following in your theme file:
<?php wp_nav_menu( array('menu' => 'Primary Navigation' )); ?>
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s