• Hi,

    I have a main menu and a header menu (from header widget). i would like different menus when a user of the site is logged in and logged out. I managed to do this for the main menu using the code:

    function my_wp_nav_menu_args( $args = ” ) {

    if( is_user_logged_in() ) {
    $args[‘menu’] = ‘logged-in’;
    } else {
    $args[‘menu’] = ‘logged-out’;
    }
    return $args;
    }
    add_filter( ‘wp_nav_menu_args’, ‘my_wp_nav_menu_args’ );

    However, I can’t seem to change the header menu. i tried using ” $args[‘secondary-menu’] = ‘header-logged-in’ “

    but that didn’t work. Any suggestions? Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter yinks94

    (@yinks94)

    Can anyone help please?

    Hi yinks94

    Wish I could help here, I’m not sure how you’d introduce an argument like this for a custom menu widget. You might need to introduce a new menu where the menu widget is going, that way you could target it like you’re targeting the main menu.

    Perhaps this is worth posting on the main WP forum with the question being introducing arguments for a menu widget.

    Sorry I don’t have more.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Vantage header Menu’ is closed to new replies.