You can use each item of WordPress menus with your conditional statements. The plugin allows visibility features to all WordPress menus you manage from the dashboard’s appearance section. It allows you to display or hide menus based on conditional statements such as show/hide this menu if the page is a single page, if a user is logged in etc.
To start, first install and activate the If Menu plugin then visit your area Dashboard -> Appearance -> Menus page and select a menu from the ‘Select a menu to edit‘ drop box. [Read: How To Create & Manage WordPress Menus?]
Let’s say you want to add a ‘Login’ link in your navigation menu but you want to show it only to logged-out users (as it is of no use for logged-in users) then first add the custom login to your menu structure and tick ‘Enable Conditional Logic ‘ checkbox.
As you tick this option it starts showing a show/hide dropdown box with if conditional logic options as shown in the given screenshot. Now select a show or hide option and then choose your visibility conditions.
In the above example, we have selected the hide option with the conditional statement ‘if a user is logged in’ to make the login button automatically disappear for all logged-in users. Alternatively, in the above-given case, we can also use the ‘show’ option for all ‘logged out’ users.
The plugin lets you set basic visibility rules such as the user is logged in, its user role, the page type (front page, archive page, search page single page or post), or the visitor device is mobile. It also offers a premium version with an advanced set of visibility rules such as the visitor’s location, visitor’s language, based on WooCommerce subscriptions or memberships, his WishList, and its subscription level.