in most of the site now anyone wants menu dynamic and wordpress already has functionality to create many menu from admin side and display dynamically in front end side anywhere in any pages wherever user wants to add. so lets i explain whole functionality step by step
Step-1 : Open Menu Pages
Go to your wordpress site admin panel for e.g http://mysite.com/wp-admin and than follow same like below image i.e find Menus menu on Appearance menu on left side on admin panel.
step 2: Create Menu Name
after completing first step we can see page like above screen image, in that we have to just create Menu name and click on Create Menu Button
Step 3: How to Add Items on created Menu
on above image we can see on left side there are tab like. Pages,Custom links and categories so we can choose any of them and add any item on created menu same as like in above screen. so do same like in above screen.
Step 4: How to check How many Items exist on any menu
on above screen we can see how many items exist on Header menu. so follow same thing as per in above screen.
Step 5: Manage Menu Locations
this portion is for identify and set menu location i.e according to above image there are totally three menu exist on site so which menu for which that we have to assign. so according to that we will display on front end side. By Default in many themes only one menu was there i.e Primary Menu but no need to worry we can create any no of menu in any wordpress theme. will explain you in next step how to do that.
Step 6: How To Add new Menu Locations from Theme
According to above screen there are totally three menu and its code something like this in functions.php.
'primary' => __( 'Primary Menu', 'twentyfifteen' ),
'social' => __( 'Social Links Menu', 'twentyfifteen' ),
'footer' => __( 'Footer Links Menu', 'twentyfifteen' ),
Go to your current activated theme. in my case my current theme is twentyfifteen so will add code on twentyfifteen/functions.php. now i m adding one new menu i.e sidebar so we have to add one line of code after footer line of above code
'Sidebar' => __( 'Sidebar Links Menu', 'twentyfifteen' ),
you just need to find register_nav_menus word on functions.php and if you found anything on that array and you need to just add your menu name with its title and theme name. so it will adding automatically on admin side.. lets see its screen below
Step 7: How to Display Menu in front end side
<?php wp_nav_menu( array( 'theme_location' => 'primary-menu', 'menu_class' => 'menu', 'container' => '' ) ); ?>
you need to just pass your menu name instead of primary-menu if your name is different than priamry-menu.