WordPress.org

Forums

Polylang
[resolved] Menu not working (7 posts)

  1. Code Themes
    Member
    Posted 2 years ago #

    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')); ?>

    https://wordpress.org/plugins/polylang/

  2. Chouby
    Member
    Plugin Author

    Posted 2 years ago #

    And how did you register your nav menu?

  3. Code Themes
    Member
    Posted 2 years ago #

    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' ),
    ) );

  4. yivi
    Member
    Posted 2 years ago #

    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

  5. Code Themes
    Member
    Posted 2 years ago #

    I have done that as well

  6. Chouby
    Member
    Plugin Author

    Posted 2 years ago #

    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.

  7. Code Themes
    Member
    Posted 2 years ago #

    Haha, that solved it. Silly of me. And Thank you for the response.

    Regards

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Polylang
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic