Menu registering and usage in WordPress

  • 0

In functions.php add following code:

Here we going to declare two menus header_menu, footer_menu

<?php register_nav_menus( array(‘header_Menu’ => __( ‘Header Menu’, ‘themename’ ),’footer_menu’=> __( ‘Footer Menu’, ‘themename’ ) )); ?>

Then you can call these menu anywhere as follows:

<?php wp_nav_menu(array(‘theme_location’ => ‘header_Menu’)); ?>

In functions.php add following code: Here we going to declare two menus header_menu, footer_menu <?php register_nav_menus( array(‘header_Menu’ => __( ‘Header Menu’, ‘themename’ ),’footer_menu’=> __( ‘Footer Menu’, ‘themename’ ) )); ?> Then you can call these menu anywhere as follows: <?php wp_nav_menu(array(‘theme_location’ => ‘header_Menu’)); ?>

In functions.php add following code: Here we going to declare two menus header_menu, footer_menu <?php register_nav_menus( array(‘header_Menu’ => __( ‘Header Menu’, ‘themename’ ),’footer_menu’=> __( ‘Footer Menu’, ‘themename’ ) )); ?> Then you can call these menu anywhere as follows: <?php wp_nav_menu(array(‘theme_location’ => ‘header_Menu’)); ?>

Leave a Reply

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