Today’s tip is about using the wordpress built in menu functions. If implemented correctly these will let you customize the menus and help you manage the blog much more easier.
First you need to open functions.php and “register” the menus. Just put in the following line:
register_nav_menus( array(
'primary' => __( 'Primary Navigation', 'test binar' ),
) );
The code above will register only one menu. If you want more just extend the array.
Once the menus are registered the only thing that needs to be done is to “mark” their position in the template.
Open the template file (usually header.php) and locate the menu lines. The menus are built using html code or wordpress functions like wp_list_pages. Replace those lines with:
wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) );
Save and go in Admin Appearance tab. You will see the Menu interface is enabled and ready to use.Just build a menu, put some links in and assign them to primary location and you are ready to go.
