How to create and customize a menu in word press 5.8 by coding

Viewed 18

I'm new to word press. For creating a new menu, I'm using register_nav_menus() function inside functions.php to register a menu. But I still need word press admin panel to add items in a menu e.g contact, about us pages. How can I add these options by coding instead of using admin panel of word-press.

function register_menu(){
    register_nav_menus(
        array(
            'primary-menu' => 'Primary Main Menu',
            'footer-menu' => 'Footer  Menu'
        )

    );
}
add_action('init', 'register_menu');
0 Answers
Related