Reputation: 305
Hi, I am trying to find the theme like one in the above, Whether can I create a menu and put them in different positions.
Or I have to code it from the beginning??
Upvotes: -1
Views: 292
Reputation: 8348
Register nav menu in your theme file. Usually in functions.php file. Once you register the nav menu than call it where you wan to show it. In your case sidebar.
If you want two different navigation items than you will have to register two navs. However, if you want the same nav items controlled from the same menu in admin area than you can register one nav and use the same for sidebar and header locations. Than you can play around with css to style differently.
function register_my_menu() {
register_nav_menu('header-menu',__( 'Header Menu' ));
}
add_action( 'init', 'register_my_menu' );
function register_my_menus() {
register_nav_menus(
array(
'header-menu' => __( 'Header Menu' ),
'sidebar-menu' => __( 'Sidebar Menu' )
)
);
}
add_action( 'init', 'register_my_menus' );
wp_nav_menu( array( 'theme_location' => 'header-menu' ) );
wp_nav_menu( array( 'theme_location' => 'sidebar-menu', 'container_class' => 'my_sidebar_menu_class' ) );
For more details you should checkout WordPress documentation for Navigation Menus
Upvotes: 1