In last post I showed you how to add a favicon image to your WordPress blog’s front-end, but what about the back-end? Yes, you can also add a favicon to WordPress admin panel, which is the back-end of your WordPress.
Lot of users edit WordPress’ core files for this task, but I strongly discourage that. Any changes you make to core files will be overwritten when you update WordPress. We will do it in an easier way.
Add following in your theme’s functions.php file, or into a custom plugin:
add_action('admin_head', 'show_favicon'); function show_favicon() { echo '<link href="FAVICON IMAGE URL" rel="icon" type="image/x-icon">'; }
Replace FAVICON IMAGE URL in above code with the URL of your favicon image.
Thank you for the useful snippet, I was just looking for it and it works!
Your welcome! Thanks for visiting as it’s a new website :)
It not working …still my FAVICON img is blank
Clear browser cache or try from a different browser. It takes a bit time for your browser to store new cache files.
Thanks!
function add_my_favicon() {
$favicon_path = ‘put_favicon_icon_url’;
echo ”;
}
add_action( ‘wp_head’, ‘add_my_favicon’ ); //front end
add_action( ‘admin_head’, ‘add_my_favicon’ ); //admin end
tell me procedure for custom favicon
like custom logo.
Very helpful thanks – worked immediately.