WordPress.org

Ready to get started?Download WordPress

Forums

wp_nav_menu Trouble when changing (1 post)

  1. ikbm
    Member
    Posted 10 months ago #

    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

Reply

You must log in to post.

About this Topic