I was recently introduced to a very useful plugin, which allows you to hide menu items based on whether a user is logged in or out, or beyond that, depending on their user role.
Nav Menu Roles tacks on the nav_menu functionality that was introduced in WP 3.0 (can you remember having to build menus by hand prior to that!?!) and adds a contextual menu to each menu item, where you can specify which users should be able to see each item.
You can choose from the more global settings of “All logged-in users” and “All logged-out users” to permissions that are based on each user’s individual role, so you can specify particular menu items to be hidden from subscribers, authors and contributors for instance, while being visible to editors and administrators.
You won’t really need me to provide you with any instructions, as once it’s installed, it’s incredibly evident how it works. Just select which menu item to impose a restriction on and select who should or should not see it.
This is great for premium membership sites, so that you can provide easy links to premium content for logged-in users, or for providing a login and logout button in your menu, where the login button is only visible to logged-out users and the logout button is only visible to logged-in users. Smart huh!?
Dave Clements has been building websites for close to a decade and in 2010, he formalised that by starting his own company, The UK Edge. He now works on a variety of web projects, from simple tasks like installing a new WordPress site, to consulting on problems, or redesigning his clients' sites. He also runs Do It With WordPress, a site dedicated to providing free tutorials on WordPress.
When he's not building your new website, you can find Dave eating Wheat Thins, spending time with friends and family, watching Indie films, fostering kittens from the local Humane Society, listening to some dubstep, dance and electronic rock, and exploring the world.
Thanks for the heads-up on the plugin, Dave. Am I correct in assuming, however, that if I set a menu item to only be visible to Contributors, that the item will be available to Contributors and above? Or is it exclusive to that level? In the screen cap, they look like checkboxes, not radio buttons.
I haven’t tried it, but since they are checkboxes and not radio buttons, I would assume that you would have to check each box for each level that you wanted to see the menu item, not just the lowest level of a group that you want to be able to see it.
January 6, 2013 at 12:06 am
Thanks for the heads-up on the plugin, Dave. Am I correct in assuming, however, that if I set a menu item to only be visible to Contributors, that the item will be available to Contributors and above? Or is it exclusive to that level? In the screen cap, they look like checkboxes, not radio buttons.
Thanks!
–Sean
January 7, 2013 at 9:13 am
I haven’t tried it, but since they are checkboxes and not radio buttons, I would assume that you would have to check each box for each level that you wanted to see the menu item, not just the lowest level of a group that you want to be able to see it.