Hi @hcmendez,
Try adding these to your child theme files.
/**
* admin-style.css
*/
/** Custom Logo for the Admin Pages */
#wpadminbar #wp-admin-bar-wp-logo > .ab-item .ab-icon:before {
color: transparent ;
background: url(http://something.local/wp-content/uploads/2020/07/icon-72x72-1.png) no-repeat scroll 0 0 / 100% auto !important;
}
/**
* functions.php
*
* Enqueue an admin style sheet only on the edit post page.
*
* References
* - https://developer.wordpress.org/reference/functions/get_current_screen/
*/
function my_child_admin_css()
{
$currentScreen = get_current_screen();
if( $currentScreen->id === 'post' ) {
wp_enqueue_style( 'child-admin-style', get_stylesheet_directory_uri() . '/admin-style.css', false, '1.0.0' );
} // if
}
add_action( 'admin_enqueue_scripts', 'amy_child_admin_css' );
-
This reply was modified 5 years, 11 months ago by
mark l chaves. Reason: Formatting
Hello, thanks for answering, what if i don’t have a child theme?
Then you would put these customisations in your parent theme files. The next time you upgrade your theme, these changes could/will vanish. Hint: always use a child theme if you are adding custom code.
BTW, there’s a small typo in the functions.php code above. Here’s the correct line (changed amy_ to my_).
add_action( 'admin_enqueue_scripts', 'my_child_admin_css' );
thanks for answering again, can i put this codes in a code snippet? via the plugin code snippets.
Hi @hcmendez ,
You’re welcome.
Good question. I don’t know of that plugin. Have you asked the plugin’s author or support forum?
Thanks!
Hello, i just created a child theme and wrote the code but i get errors
View post on imgur.com
EDIT: error disappeared but isn’t working i keep seeing the wordpress logo
-
This reply was modified 5 years, 11 months ago by
hcmendez.
-
This reply was modified 5 years, 11 months ago by
hcmendez.
Hello @hcmendez ,
In your child theme’s functions.php, please make sure you remove this line.
?>
It’s right after you load your first add_action() function call.
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
?>
It should work after that unless there’s another error. If it still doesn’t work, you’ll need to make sure your admin child style sheet is being loaded (inspect your source code) and use your dev tools to inspect the CSS where the logo should be.
Good luck!