Sometimes we want to show different menus to logged in users than logged out users. Especially it could be useful when we have for instance a e-commerce shop. So how to do it?
Step 1 - create menu for logged in users.
Notice the menu ID - it will be required later. So menu for logged users should have a "LOGOUT" menu item.
Step 2 - create menu for non-logged in users:
Step 3
Open functions.php
file which is in your theme directory and paste this code:
That's all! Now you can see you have two different menus depended on you are logged in or not.
Top comments (0)