• Resolved mgrules

    (@mgrules)


    Hi everyone,

    hope you can help me out, because I’m stuck with this for almost two days now.

    I made a theme with three custom navigations, one in the header, two in the footer. Problem is: when I view the page, all three locations show the same menu and not the attributed ones.

    The code for my functions.php is:

    function register_my_menus() {
      register_nav_menus(
        array(
          'header' => __( 'Header Menu' ),
          'footer_left' => __( 'Footer Left' ),
          'footer_right' => __( 'Footer Right' )
        )
      );
    }
    add_action( 'init', 'register_my_menus' );

    The code in my footer.php is (the header navigation is positioned absolute):

    <?php wp_nav_menu( array('footer_left' => 'Footer Left' )); ?>
    <?php wp_nav_menu( array('footer_right' => 'Footer Right' )); ?>
    <?php wp_nav_menu( array('header' => 'Header Menu' )); ?>

    As far as I can see, the menus are setup properly in the WordPress backend. Any ideas what I am doing wrong here? Any help is appreciated.
    Thanks in advance!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter mgrules

    (@mgrules)

    FYI: deactivating all plugins made no difference.

    Thread Starter mgrules

    (@mgrules)

    Oh boy, live is hard! Finally found my mistake. For every one with the same problem: it needs “theme_location” first, than the menu name.

    <?php wp_nav_menu (array('theme_location' => 'footer_left'));?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Error: Duplicate Custom Navigations’ is closed to new replies.