Menu not working
-
I have problem with my navigation menu. I created Menu in both languages, “Deutsch” and “English”. Deutsh being the default. While I change language from the switcher, everything changes but menu. I have called my menu as following: <?php wp_nav_menu(array(‘theme-location’=>’primary’,’menu_class’ =>’nav navbar-nav’)); ?>
-
And how did you register your nav menu?
Through functions.php
// Enable Menus
register_nav_menus( array(
‘primary’ => __( ‘Top primary menu’, ‘cassa’ ),
‘footer-1’ => __( ‘First Footer Menu’, ‘cassa’ ),
‘footer-2’ => __( ‘Second Footer Menu’, ‘cassa’ ),
‘footer-3’ => __( ‘Third Footer Menu’, ‘cassa’ ),
‘footer-4’ => __( ‘Fourth Footer Menu’, ‘cassa’ ),
‘footer-5’ => __( ‘Horizontal Footer Menu’, ‘cassa’ ),
) );You need to register each menu as belonging to each language, through Preferences->Appeareances->Menus (wp-admin/nav-menus.php)
Like so: http://imgur.com/WydWeqj
I have done that as well
That looks correct for register_nav_menus. I did not notice yesterday but the ‘theme-location’ index is wrong in wp_nav_menu. ‘theme_location’ is the right index to use.
Haha, that solved it. Silly of me. And Thank you for the response.
Regards
The topic ‘Menu not working’ is closed to new replies.