1

Weird Problem: I registered two menus (theme-positions) and then added two different menus to each (in Wordpress Admin), but it always shows same menu in both positions:

sidebar.php

<?php
wp_nav_menu( 

    array( 
        'menu_name' => 'Header Menu',
        'theme-location' => 'header-menu',
    )

);

?>

<div id="menu-content" class="back-canvas">
    <div class="inner-menu-content">
</div>

</div>

<?php

wp_nav_menu( 

    array( 

        'menu_name' => 'Footer Menu',

        'theme-location' => 'footer-menu'

    )

);

?>

functions.php

add_action( 'init', 'bc_init' );
function bc_init() {
add_editor_style( get_stylesheet_directory_uri() . '/css/editor-style.css'    );
    load_theme_textdomain( 'bc_leimcke', get_template_directory() . '/lang' );
    register_nav_menus( array(
        'header-menu' => 'Header Menu',
        'footer-menu' => 'Footer Menu'
) );
 }

has anyone had the same problem? any hints?

0

I can see a syntax error:

replace 'theme-location' by 'theme_location'.

Always think about underscores in Wordpress variables/functions names ;)

wp_nav_menu() : https://codex.wordpress.org/Function_Reference/wp_nav_menu

| improve this answer | |
  • unbeliveable i didn't see that! Thank YOU! – Gooze May 11 '15 at 17:02
0

Go to Dashboard > Appearance > Menus, then under your menu links you see Menu Settings.

Check if position of each menu is checked as you want.

| improve this answer | |
  • Yes, in the Admin-Panel everything is as i want it. I've even looked at the database, and themes_options in wp_options table has different values in the JSON-Like option_value. I realy can't imagine why Wordpress is giving me two exactly same menus – Gooze Apr 14 '15 at 0:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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