- Connect to your WordPress website using FTP or cPanel File Manager.
- Navigate to the wp-content folder and then to the themes folder.
- Locate the folder for the active theme of your website.
- Look for the file named functions.php and edit it.
- Add the following code at the end of the file:
function custom_admin_logo() {
echo '<style type="text/css">
#wpadminbar #wp-admin-bar-wp-logo > .ab-item .ab-icon:before {
background-image: url(' . get_bloginfo('stylesheet_directory') . '/images/your-logo.png) !important;
background-position: 0 0;
}
</style>';
}
add_action('admin_head', 'custom_admin_logo');
- Replace "your-logo.png" with the file name of your custom logo.
- Save the changes to the functions.php file.
- Clear your browser cache and login to your WordPress admin dashboard to see the new logo.