Skip to content

Instantly share code, notes, and snippets.

@nszumowski
Forked from jhned/awesome-wordpress-favicons
Last active April 22, 2016 16:46
Show Gist options
  • Select an option

  • Save nszumowski/6647a80ebe6b9415e9a3 to your computer and use it in GitHub Desktop.

Select an option

Save nszumowski/6647a80ebe6b9415e9a3 to your computer and use it in GitHub Desktop.
Ever wanted to set up custom favicons in the WordPress admin or on the WordPress login screen? Well, now you can.
// First, create a function that includes the path to your favicon
function add_favicon() {
$favicon_url = get_stylesheet_directory_uri() . '/images/icons/admin-favicon.ico';
echo '<link rel="shortcut icon" href="' . $favicon_url . '" />';
}
// Now, just make sure that function runs when you're on the login page and admin pages
add_action('login_head', 'add_favicon');
add_action('admin_head', 'add_favicon');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment