WordPress 3.8 is out I have the following code to remove admin bar logo.
function no_wp_logo_admin_bar_remove() {
global $wp_admin_bar;
$wp_admin_bar->remove_menu('wp-logo');
}
add_action('wp_before_admin_bar_render', 'no_wp_logo_admin_bar_remove', 0);
However I would like to know how can I replace it with my own logo (upload) and not a dashicon?
That’s controlled by a Dashicon (font icon) and a before statement:
What you’d want is to replace the content call.
Use a built in Dashicon from here: http://melchoyce.github.io/dashicons/
So the smilie would be
content: 'f328
;`I was also searching for the same and found no “hookey” way to change it.
But here is the alternate solution for this: and it has two possible ways.
Assume that we are using some image icon over there, let it be your brand / site icon.
First method: (Easy) Use uploaded png logo
Inside your function.php / plugins file
Second method: Dashicon method: Using custom dashicons/ icon fonts.
Create your own icon files.
You can use IcoMoon.How to create the icon file?
Create your icon in SVG and use icomoon to generate your font file from SVG.
Now add the font to your markup.
please use exact urls and unicode as per your need.
Replace [TEMPLATE_DIRECTORY] and [UNICODE].
Explanation:
I did not found any hooks to change that in a pretty straightforward manner also it was not available in older versions too. If there is then please let me know in the comments below!
However the idea is to override the css and use your own icon file instead of the default one. In previous versions, WP was using the png image icon with a background property which was easy to override though.
The latest versions of WordPress is using the icon font (dashicons) method for this and also this icon set has other icons. So you cannot simply remove that if you just wanna change the WordPress icon.
You may place your own logo there like this:
But, if you wanted to completely remove the corresponding WordPress menu, including the W logo and its sub-menu stuff and then add your ownlogo, You may do it like this:
Then let some
CSS
do the remaining part for you:Use this plugin
https://wordpress.org/plugins/white-label-cms/
or
Try This Code