get_stylesheet_directory_uri() 是一个PHP函数,您必须在PHP文件中使用它,而不是在CSS文件中使用它。
在您的功能中。php您可以粘贴此代码,并根据需要进行更改:
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\' );