WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] If logged in/out code

[Resolved] If logged in/out code

  • I need a script that spells, if(loggedin){} else{}.

    I see the <?php wp_loginout(); ?> but thats not exactly what I’m trying to achieve.

    Thanks for your help!

Viewing 4 replies - 1 through 4 (of 4 total)
  • I’m confused. You say you’ve looked at wp_loginout(), but that’s pretty much exactly the sort of thing it shows you how to do. Like so:
    if (is_user_logged_in())
    { stuff }
    else
    { other stuff }

    What is that missing that you need?

    This is the provided description of wp_loginout()

    “Displays a login link, or if a user is logged in, a logout link.”

    I am not looking to provide a login link, I want to include my own login form.

    Oh. I see. No, I thought you had looked at the actual *code* of wp_loginout, to see how it worked.

    That code that I posted above will do what you want.

    Thank you very much, problem solved!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] If logged in/out code’ is closed to new replies.
Skip to toolbar