How to create a mostly blank menu for not-logged-in

hey. I’m building out a membership site and wondering if I can make something happen with CSS or .php with X-Theme before heading to plugins.

I’d like to have a menu with like 3 items or so, an About, a Sign Up, and a Login, for *non-logged-in’ visitors as part of a membership site. The intention is to inspire them to sign up and then give them access to the vaster menu.

how would one set a not-logged-in menu that changes once a visitor logs in?

Hey Peter,

There’s regretfully no feature in our themes to achieve what you need right now so this would require custom development.

I’d recommend you use Pro for your membership site project as you can have multiple bars in a header and by that, you can assign a class to each bar so you can target them to hide them based on logged in status. For example, if your membership plugin gives you a class of logged-in when a user is logged in and you assign a class to a bar like hide-this-bar-for-logged-in-users and combine those classes to a selector like:

.logged-in .hide-this-bar-for-logged-in-users {
    display: none;
}

If you want a programmatic approach to assigning a header based on user logged in status, you can follow this tutorial from Michael Bourne: https://michaelbourne.ca/assign-pro-header-search-results-page/

Replace the condition inside the if statement like if (is_search()) to a logged in conditional if (is_user_logged_in()). Or, contact the membership plugin author or support if they have their own conditionals. For more details about Conditionals, please see https://developer.wordpress.org/themes/basics/conditional-tags/

Please just remember that custom development is outside the scope of our theme support. In case what I suggested didn’t work out for you, please consult with a WordPress developer who can closely work on your site.

Thanks.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.