名言簿丨mottobook
相信文字的力量!名人名言,经典语录,深度好文,哲理故事,寓言,格言,箴言,座右铭精选,文字的光辉,犹如黑夜的明星,海上的灯塔,指引前行的方向,在潜移默化中打开格局,提升自我,成就人生!

wordpress后台登录界面调用bing每日一图以及美化代码

//添加自定义CSS
function lerm_login_style() {
    $url = 'https://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1&mkt=';
    $resolution = '1920x1080';
    $request = wp_remote_get( $url );
    $data = wp_remote_retrieve_body( $request );
    $json = json_decode( trim( $data ), true );
    if ( $json ) {
        $images = $json['images'];
        foreach ($images as $image) {
            $urlbase = $image['urlbase'];
            $image_url = 'https://www.bing.com' . $urlbase . '_' . $resolution . '.jpg';
        }
    } ?>
    <style type="text/css">
        .login {
            background:rgba(255,255,255,0.6) url(<?php echo $image_url ?>) no-repeat center;
            height:auto;
            /*filter: blur(1px);*/
        }
        #login {
            background-color:rgba(255,255,255,0.6);
            margin:10% auto 0;
            padding:2.5rem 2rem;
            box-shadow:0 0 5px 1px rgba(0,0,0,0.5);
            -moz-box-shadow:0 0 5px 1px rgba(0,0,0,0.5);
            -webkit-box-shadow:0 0 5px 1px rgba(0,0,0,0.5)
        }
        .login form {
            padding:0;
            box-shadow:none;
            background-color: initial;
        }
         .login h1 a {
            font-size:inherit;
            background-image:url("https://www.innnn.com/wp-content/uploads/2019/04/1.png");
			background-size:135px;
			width:140px;
			height:130px;
        }
        .login label{
            color: #000;
            font-weight: 800;
        }
        .login #nav a,.login #backtoblog a{
            color: #000;
        }
        .login #nav,.login #backtoblog {
            display:block;  }
    </style>
	<?php 
}
add_action('login_head', 'lerm_login_style');
//自定义登录页面的LOGO链接为首页链接
add_filter('login_headerurl', create_function(false,"return get_bloginfo('url');"));
//自定义登录页面的LOGO提示为网站名称
add_filter('login_headertitle', create_function(false,"return get_bloginfo('name');"));
//去除 WordPress 登录标题中的“- WordPress”
add_filter('login_title', 'zm_custom_login_title', 10, 2);
    function zm_custom_login_title($login_title, $title){
        return $title.' &lsaquo; '.get_bloginfo('name');
}
Scroll Up