How to display a custom menu for logged in or admin users in WordPress?

WordPress as a CMS is getting more attractive in its new versions as more and more developers start using WordPress as a tool to run niche membership solutions. One of the first things you’ll need to implement is to display a custom menu depending on your user. For instance, you could promote landing page links to your visitors, account information to your logged-in users, and custom administration report to your administrators.

Here’s how to write a small PHP filter in a custom plugin or in the function.php file to display a custom menu if your user is logged-in, an administrator or a visitor:

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top