Menu not appearing in custom theme

I made a custom theme, but the menu is not showing in appearance section. I created a separate function file named function.php and the code is:

add_theme_support( 'menus' );
function register_my_menu() {
    register_nav_menu( 'new-menu', __( 'New Menu' ) );
}
add_action( 'init', 'register_my_menu' );

and calling in header.php, the code is:

wp_nav_menu( array( 'theme_location' = 'new-menu' ) );     

How to manage it?

When I create new pages, it shows as menu.

Topic add-theme-support menus customization Wordpress

Category Web


I make a mistake while making a function file. Its correct name is functions.php not function.php..

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.