This topic has 1 reply, 2 voices, and was last updated 7 years by Laura.

  • Author
  • #149068
     Whoweez
    Participant

    Good day,

    I’d like to change menu when user is logged in.

    Now that KLEO has a primary menu and a secondary menu this code won’t work:

    function my_wp_nav_menu_args( $args = ” ) {

     

    if( is_user_logged_in() ) {

    $args[‘menu’] = ‘primary-logged’;

    } else {

    $args[‘menu’] = ‘primary’;

    }

    return $args;

    }

    add_filter( ‘wp_nav_menu_args’, ‘my_wp_nav_menu_args’ );

     

    When logged in, the primary-logged menu gets generated for the secondary menu as well… How can I specify the primary and secondary menu separately when logged in?

    Thank you,
    Wzz

    #149174
     Laura
    Moderator

    Hello, you could try using https://wordpress.org/plugins/nav-menu-roles/ or https://wordpress.org/plugins/menu-items-visibility-control/

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

Viewing 2 posts - 1 through 2 (of 2 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?