If user is logged in and an admin (show this) else (2 posts)

  1. Scott.Reinmuth
    Posted 3 years ago #

    The code I am using is not working. I want it to echo dashboard if an admin or author is logged in and I want it to show profile if a normal user is logged in. This is the code I have so far...

    if ( is_user_logged_in() && current_user_can( 'Administrator' ) ) {
        echo '<a href="">Dashboard</a>';
    } else {
        echo '<a href="/login">Login</a>';

    This is the start for if an admin logs in. What am I doing wrong?

    See my navigation at Scottreinmuth.com for a better understanding

  2. bcworkz
    Posted 3 years ago #

    To control what happens when a user logs in, start with Plugin API/Filter Reference/login redirect

Topic Closed

This topic has been closed to new replies.

About this Topic