Skip to content

Instantly share code, notes, and snippets.

@Daniel-Walsh
Created April 30, 2020 10:00
Show Gist options
  • Save Daniel-Walsh/814d2c9f3580a121900e15e8f94c4b4b to your computer and use it in GitHub Desktop.
Save Daniel-Walsh/814d2c9f3580a121900e15e8f94c4b4b to your computer and use it in GitHub Desktop.
Add a custom favicon to wp-admin #wordpress #php
<?php
// Adds a custom PNG favicon the the wp-admin area of WordPress.
add_action(
'admin_head',
function () {
echo '<link rel="icon" type="image/png" sizes="16x16" href="' . get_template_directory_uri() . '/favicon.png">';
}
);
// Adds a custom ICO favicon the the wp-admin area of WordPress.
add_action(
'admin_head',
function () {
echo '<link rel="icon" type="image/x-icon" sizes="16x16" href="' . get_template_directory_uri() . '/favicon.ico">';
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment