0

Is it possible to use the header image on top of the wp-login.php page, with placement as it would on any other page?

Customization plugins only support 1 image as the logo, but not a header image.

Thanks.

  • You can create your own template page for the login and do whatever you wish. Just call <?php wp_login_form(); ?> to display the form. – hwl Aug 11 '17 at 12:37
0

For anything other than simple CSS tweaks your best bet is to use wp_login_form() in a custom Page Template and filter login_url to return that instead of wp-login.php:

add_filter( 'login_url', 'wpse276598_login_page', 10, 3 );

function wpse276598_login_page( $login_url, $redirect, $force_reauth ) {
    return home_url( '/my-login-page/?redirect_to=' . $redirect );
}

If you wanted to redirect all successfully logged-in users to the homepage:

function wpse276598_login_page( $login_url, $redirect, $force_reauth ) {
    $redirect = get_home_url();
    return home_url( '/my-login-page/?redirect_to=' . $redirect );
}
  • if my login page is just called /global-login, then it would just be '/global-login' instead of '/my-login-page/?redirect_to='? – Magnus Pilegaard Aug 11 '17 at 12:43
  • You'd still need the ?redirect_to argument in order to pass the user to wherever they were originally going before the interstitial login. For example, if you visit /wp-admin/ while signed out, the login page will redirect you to /wp-admin/ on success. Your custom login should ideally replicate that functionality. – Chris Cox Aug 11 '17 at 12:46
  • If i just want it to go to the static home page, then how do i replicate that? Insert the link to home? – Magnus Pilegaard Aug 11 '17 at 12:50
  • Replace $redirect with get_home_url(). – Chris Cox Aug 11 '17 at 12:52
  • So $login_url, get_home_url, etc? – Magnus Pilegaard Aug 11 '17 at 12:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.