Support » Fixing WordPress » If logged in/out code

  • Resolved joshziman


    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)
  • Moderator Samuel Wood (Otto)

    (@otto42) Admin

    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 }
    { 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.

    Moderator Samuel Wood (Otto)

    (@otto42) Admin

    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 ‘If logged in/out code’ is closed to new replies.