如何从管理员更改 wordpress 默认徽标? [英] How to change the wordpress default logo from the Admin?

查看:26
本文介绍了如何从管理员更改 wordpress 默认徽标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建自定义徽标,因此需要更改 wordpress 徽标的默认徽标.

I want to create a custom logo so I need change the default logo of the wordpress logo.

推荐答案

这是将正确覆盖管理员徽标的函数(插入到 functions.php 中):

Here is the function (inserted into functions.php) which will correctly override the admin logo:

/**
* customize the admin logo that appears in the header
* http://www.wpbeginner.com/wp-themes/adding-a-custom-dashboard-logo-in-wordpress-for-       branding/
* @author Paul Bredenberg
*/

function htx_custom_logo() {
echo '
<style type="text/css">
#wp-admin-bar-wp-logo > .ab-item .ab-icon { 
background-image: url(' . get_bloginfo('stylesheet_directory') . '/assets/images/dashboard-logo.png) !important; 
background-position: 0 0;
}
#wpadminbar #wp-admin-bar-wp-logo.hover > .ab-item .ab-icon {
background-position: 0 0;
}   
 </style>
';
}

 //hook into the administrative header output
add_action('admin_head', 'htx_custom_logo');

从这里获取:http://goo.gl/GuDZM6

HTH!

这篇关于如何从管理员更改 wordpress 默认徽标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆