wplogin - juedaiyuer/researchNote GitHub Wiki

登陆页面

wordpress使用BING美图作为登陆页面背景

//自定义登陆页面
function custom_login_head(){
  $str=file_get_contents('http://cn.bing.com/HPImageArchive.aspx?idx=0&n=1');
  if(preg_match("/<url>(.+?)<\/url>/ies",$str,$matches)){
      $imgurl='http://cn.bing.com'.$matches[1];
      echo '<style type="text/css">body{background: url('.$imgurl.');background-attachment:fixed;width:100%;height:100%;background-image:url('.$imgurl.');background-attachment:fixed;-moz-background-size: 100% 100%;-o-background-size: 100% 100%;-webkit-background-size: 100% 100%;background-size: 100% 100%;-moz-border-image: url('.$imgurl.') 0;background-attachment:fixed;background-repeat:no-repeat\9;background-image:none\9;}h1 a { background-image:url('.get_bloginfo('url').'/favicon.ico)!important;width:32px;height:32px;-webkit-border-radius:50px;-moz-border-radius:50px;border-radius:50px;}#loginform {background-color:rgba(251,251,251,0.3)!important;}.login label,a{color:#000!important;}</style>';
  }}
add_action('login_head', 'custom_login_head');

source

⚠️ **GitHub.com Fallback** ⚠️