I am new in WordPress Development. How can I get Menus
in Admin Panel like below ?
I am trying to develop a theme. But I couldn't display that.
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communityI am new in WordPress Development. How can I get Menus
in Admin Panel like below ?
I am trying to develop a theme. But I couldn't display that.
You need to register custom menus in your theme - https://codex.wordpress.org/Function_Reference/register_nav_menu
You first need to register your menu in functions.php like so:
add_action( 'after_setup_theme', 'register_my_menu' );
function register_my_menu() {
register_nav_menu( 'primary', __( 'Primary Menu', 'theme-slug' ) );
}
Then, where you want your menu to appear - usually header.php - you call the function:
wp_nav_menu()
You can refer to this link for more information.
Basically, for Menus to show up, you need to use the WordPress function register_nav_menu()
to register that your theme supports at least 1 menu. Each registered menu corresponds to a checkbox under the Display location (which is under the Menu Settings header) section at the bottom of the Menu page.