WordPress login page logo customization
Question
For some reason the first code works. But the second does not. And I can't figure out what is wrong with my syntax.
background-image: url("/wp-content/themes/flawless-v1-17-child-01/images/Logo-B-Classic.jpg") !important;
background-image:url('.get_stylesheet_directory_uri().'/images/Logo-B-Classic.jpg) !important;
Solution
get_stylesheet_directory_uri() is a PHP function, you must use it in a PHP file instead of your CSS file.
In your functions.php you can paste this code and change depends on your needs:
function my_login_logo() { ?>
<style type="text/css">
body.login div#login h1 a {
background-image: url(<?php echo get_stylesheet_directory_uri(); ?>/images/Logo-B-Classic.jpg);
}
</style>
<?php }
add_action( 'login_enqueue_scripts', 'my_login_logo' );
OTHER TIPS
You Can Use This Simple Tutorial To Customize Your Wordpress Login Page : http://bloggingchimp.blogspot.com.tr/2015/03/how-to-customize-wordpress-login-page.html
Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange