Custom Login Page

Auth Values And Links

Auth templates have values for the current auth state and the main account URLs.

Values#

ValueMeaning
{{ logged_in }}Whether the current visitor is logged in.
{{ registration_open }}Whether WordPress registration is enabled.
{{ auth_action }}Current auth action, such as login, register, lost-password, or reset-password.
{{ auth_login_url }}Login URL.
{{ auth_lost_password_url }}Lost-password URL.
{{ auth_register_url }}Register URL.
{{ auth_logout_url }}Logout URL.

Branching#

Use auth_action when one file renders more than one screen:

php
{{ if auth_action == "lost-password" }}  <h1>Reset your password</h1>{{ else if auth_action == "register" }}  <h1>Create account</h1>{{ else }}  <h1>Log in</h1>{{ /if }}

Use the auth URL values instead of hardcoding wp-login.php links:

php
<a href="{{ auth_lost_password_url }}">Forgot password?</a><a href="{{ auth_register_url }}">Register</a><a href="{{ auth_logout_url }}">Log out</a>