Answer the question
In order to leave comments, you need to log in
How to change styles of wp-login.php page?
1. Tried changing login.min.css - nothing happens.
2. I tried to connect my styles - only the picture changes and does not see the file update. Roughly speaking, on ftp I have this css:
.login h1 a {background-image: url('../login/logo.png');background-size: 160px!important 45px!important;width: 160px!important;height: 45px!important;}
.login h1 a {
background-image: url('../login/logo.png');
background-size: 300px 260px;
width: 300px;
height: 260px;
function custom_login_css() {
echo '<link rel="stylesheet" type="text/css" href="'.get_stylesheet_directory_uri().'/login/login-styles.css" />';
}
add_action('login_head', 'custom_login_css');
Answer the question
In order to leave comments, you need to log in
function custom_login_logo() {
?>
<style type="text/css">
body.login div#login h1 a {
background-image: url(<?php echo get_bloginfo( 'template_directory' ) ?>/img/login_logo.png);
margin-left: 0px;
width: 300px;
padding-bottom: 0px;
margin-bottom: 0px;
background-attachment: scroll;
background-repeat: no-repeat;
background-position: center top;
background-size: auto;
}
</style>
<?php
}
add_action( 'login_enqueue_scripts', 'custom_login_logo' );
function custom_login_logo_url() {
return get_bloginfo( 'url' );
}
add_filter( 'login_headerurl', 'custom_login_logo_url' );
function custom_login_logo_url_title() {
return 'my_login_logo_url_title';
}
add_filter( 'login_headertitle', 'custom_login_logo_url_title' );
Connect the style file to the login_enqueue_scripts
hook
And in login_head , it turns out that you need to connect inline styles
And what, in fact, didn’t please you with plugins? Why edit WordPress files, it's not right-way?
If you fundamentally want your bike, then look at how it is done in the plugin and implement it in the same way. For example, Custom login
What kind of nonsense? Why do you need to write a function and use a hook to add css? Yes, these are your tsmski
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question