This topic has 3 replies, 2 voices, and was last updated 7 years by Radu.

  • Author
  • #156229
     carldufour
    Participant

    Hi,

    I am using the Kleo theme and I have installed the plugin Nav Menu Role to be able to change the menu depending on whether one is logged in or logged out.  It didn’t quite work as expected, so I tried a couple of other similar plugins with the same results :

    – When logged out, the menu appears fine !

    – When logged in, the menu does not appear at all (on every page set to “logged in”

     

    Then I removed the plugin and tried to insert the following code  in the function.php file :

    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' );

     

    The result this time is that the menu appears twice instead of once.

     

    Can you hep?

     

    Thanks.

     

    #156389
     Radu
    Moderator

    Hi,

    Users use this plugin https://ro.wordpress.org/plugins/if-menu/ with KLEO successfully please give a try. Disable that plugin before installing this.

    Cheers
    R.

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

    Great! It does work. Many thanks!

    #156503
     Radu
    Moderator

    You’re welcome

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 4 posts - 1 through 4 (of 4 total)

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

Log in with your credentials

Forgot your details?