Go to Appearance >> Menu
No “Menu” option? Enable by adding the following to functions.php
function mytheme_register_nav_menus() {
register_nav_menus( array(
'primary' => __( 'Primary Menu', 'your-text-domain' ),
'footer' => __( 'Footer Menu', 'your-text-domain' )
));
}
add_action( 'after_setup_theme', 'mytheme_register_nav_menus' );
Save the file, and it should be there under Appearance,
Display Menu on Theme
Add the following to functions.php
function wpb_custom_new_menu() {
register_nav_menu('my-custom-menu',__( 'My Custom Menu' ));
}
add_action( 'init', 'wpb_custom_new_menu' );
Replace HTML static navbar to WordPress menu by adding this line to header.php
<?php wp_nav_menu( array( 'theme_location' => 'header-menu' ) ); ?>
Leave a Reply