This afternoon I was working on a support desk site that would have logged in and logged out users.
I wanted to hide several menu items from logged out users so they were not confused… and hide the registration item from logged in users as well.
So I got thinking…. I wonder if there is a “widget logic for menus”…
Widget Logic, if you’re not familiar with it, is a plugin that adds a visibility field to your widgets and lets you use conditional expressions to determine when they do/don’t display. Very handy stuff.
But what about menus?
Turns out, you can can easily do conditional expressions, using a free plugin in the WP repository…
This free plugin has no settings of its own, but adds a visibility field to the bottom of every single menu item in your menu.
You can find it listed in the WordPress repository here => https://wordpress.org/plugins/menu-items-visibility-control/
Leave the visibility field blank to show all…. or fill it in with a conditional PHP or WordPress code statement, to get the desired effects.
Some examples include
For example, you may only want a certain menu item to display on a certain blog post… you can do that with this!
I should note that this only defines whether or not they display in the menu. If you link to them elsewhere, the person can still access them. This is not a membership control/privacy control plugin.
Simple, lightweight, effective… the perfect solution for this project and maybe for one of your projects too!
~ Kim ~
Simple Tech Tips For Marketing