Skip to main content
Commonmark migration
Source Link

You have to work with two files of the theme #No.1 functions.php #No.2 header.php Firstly

No.1 functions.php

No.2 header.php

Firstly you have to add theme support for menu and then register the menu in your theme functions.php like

You have to work with two files of the theme #No.1 functions.php #No.2 header.php Firstly you have to add theme support for menu and then register the menu in your theme functions.php like

You have to work with two files of the theme

No.1 functions.php

No.2 header.php

Firstly you have to add theme support for menu and then register the menu in your theme functions.php like

Source Link

You have to work with two files of the theme #No.1 functions.php #No.2 header.php Firstly you have to add theme support for menu and then register the menu in your theme functions.php like

 // For theme support in functions.php
 add_theme_support('menus');
 //now register the menu
 function my_menu(){
    register_nav_menu('header', ' Header Menu');
 }
 add_action('init','my_menu');

Secondly code in your header.php

 <div class="header_menu" id="header_menu">
                    <?php 
                        $defaults = array(
                            'theme_location' => 'header',
                            'menu' => '',
                            'container' => '',
                            'container_class' => '',
                            'container_id' => '',
                            'menu_class' => 'main_menu',
                            'menu_id' => '',
                            'echo' => true,
                            'fallback_cb' => 'wp_page_menu',
                            'before' => '',
                            'after' => '',
                            'link_before' => '',
                            'link_after' => '',
                            'items_wrap' => '<ul id="header_main_nav" class="nav header-nav header-bottom-nav nav-center  nav-uppercase">%3$s</ul>',
                            'depth' => 0,
                            'walker' => ''
                            );
                        wp_nav_menu($defaults);
                    ?>
                </div>

and for sub menu just go to your admin panel, appearance, menu and just drag the link as sub menu as shown in figure

enter image description here

That's all.