我对wp登录做了一些修改。php,它在2个测试站点上运行良好。他们运行的是更高版本的php,我认为他们都运行的是php 7。主站点运行php 5.4或其他相关内容。我在主站点上尽快上传子主题,然后wp登录。php页面变为空白。
重要的是,除了wp登录外,网站上的其他所有内容都会显示出来。phpI认为它可能是低PHP版本,但我不确定。
以下是代码:
function my_login_stylesheet() {
wp_enqueue_style( \'custom-login\', get_stylesheet_directory_uri() . \'/login_styles.css\' );
}
add_action( \'login_enqueue_scripts\', \'my_login_stylesheet\' );
function my_login_logo() { ?>
<style type="text/css">
#login h1 a, .login h1 a {
background-image: url(../wp-content/uploads/2017/08/login_logo.png);
height: 125px;
width: auto;
background-size: 125px;
background-repeat: no-repeat;
}
</style>
<?php }
add_action( \'login_enqueue_scripts\', \'my_login_logo\' );
function my_login_logo_url() {
return home_url();
}
add_filter( \'login_headerurl\', \'my_login_logo_url\' );
function my_login_logo_url_title() {
return \'\';
}
add_filter( \'login_headertitle\', \'my_login_logo_url_title\' );
为什么它不起作用?