Viewing 4 replies - 1 through 4 (of 4 total)
  • esmi

    (@esmi)

    Thread Starter donohuge

    (@donohuge)

    thanks! Where do I add that code?

    Dipali Dhole

    (@dipalidhole27gmailcom)

    first you have to register both the menus in theme’s functions.php file.
    below is the code for register menus.

    register_nav_menu( 'logged-in-menu', __( 'Logged In Menu' ) );
    register_nav_menu( 'logged-out-menu', __( 'Logged Out Menu' ) );

    And then find from where the the extsting menus are displaying.
    mostly it is in theme’s header.php file.
    find wp_nav_menu function in header.php file and Replace with below code

    <?php if ( is_user_logged_in() ) {
         wp_nav_menu( array( 'theme_location' => 'logged-in-menu' ) );
    } else {
         wp_nav_menu( array( 'theme_location' => 'logged-out-menu' ) );
    } ?>
    Thread Starter donohuge

    (@donohuge)

    Still can’t get it to work. Is there something really basic I’m missing?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘display alternate menu’ is closed to new replies.