0

EDİT -----

Maybe it's being helpful. The problem is here:

<?php wp_nav_menu(array('the_location'=>'primary')); ?>

İt must being

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

I am really angry because I am trying an 1 hour for this little problem and I found nothing. Firstly, I am newbie in Wordpress but I think I wasn't doing any error here. Anyway, I add the code below.

Header.php

<?php wp_nav_menu(array('the_location'=>'primary')); ?>

İndex.php

 <?php wp_nav_menu(array('the_location'=>'secondary')); ?>

funcstions.php

function register_menu() {
add_theme_support('menus');

register_nav_menus( array(  
  'primary' => __( 'Primary Navigation' ),  
  'secondary' => __('Secondary Navigation')  
) );

}

add_action('init','register_menu');

And wordpress panel screenshots:

enter image description here

  • So.... what's your question? – bosco Oct 3 '16 at 22:29
0

You've got the code close, but incorrect. It is a spelling issue.

It should be:

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

Please note that in your array you are using the_location and not theme_location. I believe with your mistake the menu will default to the primary menu (though I haven't confirmed this).

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.