WordPress Dynamic Menu

Step 1 : To register the menu add below code in function.php  :

<?php
function register_right_menu() {
register_nav_menu('right menu',__( 'Right Primary Menu' ));
}
add_action( 'init', 'register_right_menu' );?>

Step 2 : Display the Menu  :

<?php
wp_nav_menu( array( 'theme_location' => 'right menu', 'menu_class' => 'right_nav_menu' ) );
?>

 

Leave a Reply

Your email address will not be published. Required fields are marked *