Support » Fixing WordPress » wp_nav_menu Trouble when changing

  • Hi,

    In header.php I programmatically change between menus (MyMenu1 and MyMenu2) like this:

    wp_nav_menu( array( 'theme_location' => 'main_menu', 'menu' => IM_menu_get_var() ) );

    Where the structure of the menus look like this:

    MyMenu1 -> Home1, Aboutme1, Contact1
    MyMenu2 -> Home2, Aboutme2, Contact2

    If I change (via a form) from MyMenu1 to MyMenu2 the correct corresponding page is not showing up. In example it shows Home1-page instead of Home2 page.

    How can I force WP to ‘load’ or rather show the correct page when the menu is changed?

    Thanks

  • The topic ‘wp_nav_menu Trouble when changing’ is closed to new replies.