Override wp-login.php styles

后端 未结 3 1257
野趣味
野趣味 2021-01-22 23:50

I have a Wordpress CMS website where most labels are needed to be white. So the theme includes the below styles per form labels.

.login label {
    color: #fff;
         


        
3条回答
  •  伪装坚强ぢ
    2021-01-23 00:29

    login_head and login_enqueue_scripts are called one after another, so it doesn't matter which one you're using...

    Using wp_enqueue_style is the best practice but it can be echo ''; without problem.

    I'm adding a solution because this isn't the kind of code that you just drop onto your theme functions.php. We want to keep the code running even if we swap themes. So a functionality plugin comes handy:

    
                .login label {}
            
    CSS;
        echo $CSS;
    }
    add_action('login_head', 'custom_login');
    

    Check the following to learn about the Heredoc sintax used to build the $CSS string: What is the advantage of using Heredoc in PHP ?

提交回复
热议问题