0

I am using social plugin and I want to use just that and hide the login and password fields from login page, how do I do that?

I have tried this code but it disables complete login area including "sign-in with google":

add_action( 'login_head', 'wpse_121687_hide_login' );
function wpse_121687_hide_login() {
    $style = '';
    $style .= '<style type="text/css">';
    $style .= '.login form{ display: none }';
    $style .= '.login #nav a, .login #backtoblog a { display: none }';
    $style .= '</style>';

    echo $style; 
}
0

I had the same question and the same issue.

But with some changes to your code, you can hide the Wordpress login and password fields, and still keep the social logon button.

Just add the code below to your theme's functions.php file

/**
* This hides the login and password fields so only the social login button is visible
*/    

add_action( 'login_head', 'wpse_121687_hide_login' );
function wpse_121687_hide_login() {
    $style = '';
    $style .= '<style type="text/css">';
    $style .= '.login label{ display: none }';
    $style .= '.login .button.wp-hide-pw .dashicons{ display: none }';
    $style .= '.login form .input{ display: none }';
    $style .= '.login form .forgetmenot{ display: none }';
    $style .= '.login #nav a, .login #backtoblog a { display: none }';
    $style .= '</style>';

    echo $style; 
}

There is probably some more tweaking that could be done, like removing the large LOGIN button, but I'm still working on it.

Any advice on improvement from an expert would be appreciated!

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.