logged-in, logged-out menu

This topic contains 4 replies, has 3 voices, and was last updated by  Mark 1 week, 1 day ago.

Tagged: 

  • Author
    Posts
  • #5007

    Mark
    Buyer
    Post count: 5

    Hello,

    please instruct me how to add additional menu items to the logged-out menu. I have only one choice of menu which is the logged in menu. But when logged out the so far correct logged out menu items appear, how can I add to them,

    Thank you,
    Mark

    #5009

    Guust
    Moderator
    Post count: 27133

    You should have a logged-in and logged-out section for UsersWP links, see image.
    If you do not have that option, make sure to tick the “UsersWP Endpoints” in Screen Options at Appearance > Menus.

    Thanks

    #5015

    Mark
    Buyer
    Post count: 5

    Hey Guust,
    thanks a lot for your prompt reply.
    I recall having had a menu option for both, Logged-in and logged-out but when repeated the setup and gave the menu a name those option disappeared.
    So let me reset once again without changing the menu name and be done.

    Thanks

    #5032

    Alex Rollin
    Moderator
    Post count: 19654

    Only the menu links that come with UsersWP do the logged in/ logged out thing. Hiding / showing other links isn’t a features of UsersWP.

    #5038

    Mark
    Buyer
    Post count: 5

    I read you Alex, thank you.

    I came across this snippet on wpbeginner, that allows for two separate menus:

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

    All good, should you not hear from me again, means it works.

    Thank you,
    Mark

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

You must be logged in to reply to this topic.