自定义登录页面的LOGO图片

[php]
function my_custom_login_logo() {
echo '<style type="text/css">
h1 a { background-image:url('.get_bloginfo('template_directory').'/images/logor.png) !important; }
</style>';
}
add_action('login_head', 'my_custom_login_logo');
[/php]

 

自定义登录页面的LOGO链接为首页链接

[php]
add_filter('login_headerurl', create_function(false,"return get_bloginfo('url');"));
[/php]

 

自定义登录界面LOGO链接为任意链接

[php]
function custom_loginlogo_url($url) {
return 'http://www.douyaolai.com'; //修改URL地址
}
add_filter( 'login_headerurl', 'custom_loginlogo_url' );
[/php]

 

自定义登录页面的LOGO提示为网站名称

[php]
add_filter('login_headertitle', create_function(false,"return get_bloginfo('name');"));
[/php]

 

自定义登录页面LOGO提示为任意文本

[php]
function custom_loginlogo_desc($url) {
return '数字城堡'; //修改文本信息
}
add_filter( 'login_headertitle', 'custom_loginlogo_desc' );
[/php]

 

在登录框添加额外的信息

[php]
function custom_login_message() {
echo '

欢迎来到'.get_bloginfo('name').',tel:177

';
}
add_action('login_form', 'custom_login_message');

[/php]

 

自定义底部信息

[php]
function custom_html() {
echo '

© ' . get_bloginfo(url).'

';
}
add_action('login_footer', 'custom_html');
[/php]

 

添加自定义CSS

[php]
function custom_login() {
echo '<link rel="stylesheet" type="text/css" href="' . get_bloginfo('template_directory') . '/login_style.css" />';
}
add_action('login_head', 'custom_login');
[/php]

 

所需要的CSS样式

[php]
/** 背景及字体 **/
html,body.login{
background:#f2f2f2;
font: 14px 'Microsoft YaHei', Arial, Lucida Grande, Tahoma, sans-serif;
}
/** 去掉链接下划线 **/
html a{
text-decoration: none;
}
/** 登录DIV **/
#login {
background:#fff;
border: 1px solid #ccc;
width:400px;
margin: 40px auto 0;
padding: 10px 10px 20px 10px;
border-radius:5px;
box-shadow:0 4px 10px -1px rgba(200, 200, 200, 0.7);
}
/** 替换logo **/
.login h1 a{
background: #fff url(logo.png) no-repeat center;
width:400px;
height: 300px;
}
/** 提示 **/
.updated, .login .message {
background:#fff;
border: none;
text-align: center;
}
/** 表单 **/
.login form {
box-shadow:none;
border: none;
}
#loginform, #registerform, #lostpasswordform{
background:transparent;
border:none;
}
/** 按钮 **/
.button-primary,.submit .button-primary,#login form .submit input {
width:83px;
height:25px;
font-weight: bold;
border:none;
}
[/php]

 

 

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。