• Resolved sas40

    (@sas40)


    When clients logged in, I want that they see an other menu than logged out. A logged in menu like this: logout – my listings – add a listing. An when they are logged out, they only see a logged out menu like: login or create a listing

    I have made a snippet:
    function my_wp_nav_menu_args( $args = ” ) {

    if( $args[‘theme_location’] == ‘primary’ ){
    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’ );

    This works! But it doesn’t work as responsive. I have made a template with Generate Press. How can I make it works also responsive.

    Or do anyone know an other sollution?
    Thank you on forehand!

Viewing 1 replies (of 1 total)
  • Plugin Support Garret L

    (@garret1996)

    Hi @sas40

    Thank you for reaching out about this. I’m Garret from the customer success team and I’m sorry to hear that you’re having a problem here. I’ll be happy to help!

    Unfortunately, help with writing, customizing, and debugging custom code isn’t covered by our support. We don’t have a quick answer for this, and it would take quite a bit of development time to research and test it.

    We have had to make the hard decision that our limited development time is best spent on the things that will help the most people. As a result, we recommend more complex questions that are not documented go to other resources that may be helpful. There are a few great resources to help you out here.

    1) Codeable has WordPress expert developers available for short-term projects
    2) Tilden Tasks does longer WordPress tasks, but they break it down to 1 task per day.
    3) Upwork (formerly known as oDesk) to help out if you think this is beyond your current skill set. There’s a lot of decent folks on there as well.

    I hope you understand our policy on this, that custom code questions are not something we can feasibly support.

    Best,

Viewing 1 replies (of 1 total)
  • The topic ‘Hide/Show menus when logged in/out’ is closed to new replies.