我正在使用wordpress 4.1并试图在没有任何插件的情况下更改domain.com/wp-admin中的徽标,但在DOM文件中找不到任何我已经使用this method的解决方案,但仍然不工作我错过了什么
此代码wp-login:
wp_admin_css( 'login', true );
/*
* Remove all stored post data on logging out.
* This could be added by add_action('login_head'...) like wp_shake_js(),
* but maybe better if it's not removable by plugins
*/
if ( 'loggedout' == $wp_error->get_error_code() ) {
?>
<script>if("sessionStorage" in window){try{for(var key in sessionStorage){if(key.indexOf("wp-autosave-")!=-1){sessionStorage.removeItem(key)}}}catch(e){}};</script>
<?php
}
/**
* Enqueue scripts and styles for the login page.
*
* @since 3.1.0
*/
do_action( 'login_enqueue_scripts' );
/**
* Fires in the login page header after scripts are enqueued.
*
* @since 2.1.0
*/
do_action( 'login_head' );
if ( is_multisite() ) {
$login_header_url = network_home_url();
$login_header_title = get_current_site()->site_name;
} else {
$login_header_url = __( 'http://sumayku-design.web.id/' );
$login_header_title = __( 'sumayku-design' );
}
和风格:
.login h1 a {
background-image: url(http://www.blog.sumayku-design.web.id/wp-content/uploads/2015/01/petra-truss-logo.png);
-webkit-background-size: 84px;
background-size: 84px;
background-position: center top;
background-repeat: no-repeat;
color: #999;
height: 84px;
font-size: 20px;
font-weight: normal;
line-height: 1.3em;
margin: 0 auto 25px;
padding: 0;
text-decoration: none;
width: 84px;
text-indent: -9999px;
outline: none;
overflow: hidden;
display: block;
}
答案 0 :(得分:1)
那应该是对的。
但也有选择:
但不是编辑默认的CSS,而是更好地添加一个新的CSS文件(放在页面中的另一个之后), 并在其中放置这样的内容来覆盖登录图像:
.login h1 a {
background-image: url(../images/newlogo.jpg);
}
答案 1 :(得分:1)
通常我使用下面编写的代码,在更改管理员徽标时工作正常:
function custom_login_logo() {
echo '<style type="text/css">
h1 a { background-image: url(/wp-content/uploads/2014/10/logo.png) !important;
background-size: 100% 100% !important;
background-position: center center !important;
height: 82px !important;
width: 359px !important;
margin-left: -14px !important;
}
</style>';
}
add_action('login_head', 'custom_login_logo');