• Hello, I made some login pages and a page template to make any page password protected. Using this code basically: <?php if (is_user_logged_in()) : ?> <?php else :?> <?php endif;?>. What I’ve found is I need two different sections password protected, so users with certain roles can only access them, not just logged in users.

    What I’m trying to figure out, is how to apply the the same thing so I can say: if the users role is this, do this; else do this. So that I can have say an employee login section and a dealers section for example. Then people with certain roles can only access certain sections.

    Thanks in advance if anyone has any pointers, I’m really getting stumped on this, I’ve been looking around for quite a while. Nothing I can find seems to be making it click.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘if else based on a users role’ is closed to new replies.