Skip to main content
Asked a question 3 months ago

How to make Navigation Bar appear to only logged In Users?

Where am I?

In Tribe you can ask and answer questions and share your experience with others!

Tribe sets 3 body classes that help us differentiate between admin, member, and a visitor (non-logged in user).

  • role-admin = is added when admin user is logged in.
  • role-member = is added when member user is logged in.
  • role-guest = is added for general visitors that are not logged in.

This helps us specify CSS for these specific use cases. For example, we have a simple navbar for public visitors. But when user logs in, we show navbar with menu options that match our client area.

So if you want to hide navbar by default and show it to logged in members and admins, you can use this CSS:

.role-guest .main-navbar.menu14{ display: none !important }

Please note, you need to remove number 5 from the .menu5 class. It should be .menu. It's a bug in Tribe.

Hope that helps.