1

My task is to create local menu which will be displayed if specific page is open (checking page). For now I would like to display my custom menu. I am creating custom menu from Appeerance-Menus. After theat in functions.php I am doing the following:

function register_my_menus() {
 register_nav_menus(
  array(
  'explore_menu' => __( 'Explore Menu' ),
      )
    );
  }

 add_action( 'init', 'register_my_menus' );

AFter that I mark the check box Explore menu in the dashboard, such that my menu is marked as Explore menu. In my page.php I am adding this:

<div id="primary" class="content-area">  
  <?php wp_nav_menu( array(
        'theme_location' => 'explore_menu'
    ) );
 ?>

I expect to see the menu I created, but I dont see it. WHat could be the problem???

1 Answer 1

0

I had the same problem some time ago and solved it by adding my custom menu in my custom theme header.php (inside tag) instead of page.php.

wp_nav_menu( array( 
    'theme_location' => 'my-custom-menu', 
    'container_class' => 'custom-menu-class' ) );

Here you can find a brief explanation about how to create and insert your custom menu

Hope you can solve it!

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.