Displaying dynamic menus based on logged in status is quite straight forward and any developer you’re gona ask will tell you the same thing.
Regardless of that, up to this point, the only way show a different menu to your logged in users was to add a bit of code to your theme header, some conditional tags and you’re good to go.
Include the wp_nav_menu calls in your theme’s header.php file:
It’s all fairly straight forward, but the problem appears when you try to explain that to a non technical person. Simply put, it’s just no good enough.
So instead of copying and pasting code without even understanding what it dose, wouldn’t it be simpler to just:
- activate a plugin
- automatically get access to logged in “Theme Locations” in your Menus WordPress interface
- create another menu for logged in users
- assign it to the correct location and you’re done
No coding, no messing around with conditional tags, and most importantly, I can now answer another questions with “Just install this plugin and you’re good !”.
Dynamic Menu for Logged In Users Plugin.
It’s only 37 line long, doesn’t have any options, and generates Logged In Theme Locations for every predefined theme location inside your theme and serves the logged in version to… well… logged in users.
You can download the file but here’s the code for it as well:
I got a really cool suggestion by Pippin Williamson regarding a similar plugin but with more fine grained functionality: Nav Menu Roles. You can hide custom menu items (not just entire menu locations) based on user roles. Great to build a dynamic menu for a membership site!
If you liked this plugin you’re gona love Profile Builder PRO
Because default WordPress user registration and login is NO GOOD for modern websites.
Find out more about Profile Builder Pro (Lots of Pictures Included).
Subscribe to get early access
to new plugins, discounts and brief updates about what's new with Cozmoslabs!