Skip to content

Instantly share code, notes, and snippets.

@marktenney
Last active May 8, 2020 00:10
Show Gist options
  • Save marktenney/04fbad6da915786f5635aa7b92056346 to your computer and use it in GitHub Desktop.
Save marktenney/04fbad6da915786f5635aa7b92056346 to your computer and use it in GitHub Desktop.
<?php
/*** Add a custom favicon for the admin area ***/
function custom_admin_favicon() {
$url = ''; // Place the path to your dashboard icon here.
echo '<link rel="Shortcut Icon" type="image/x-icon" href="' . $url . '" />';
}
add_action( 'admin_head', 'custom_admin_favicon' );
/*** Add a custom default front end favicon ***/
function custom_default_favicon() {
if ( ! has_site_icon() && ! is_customize_preview() ) {
$url = ''; // Place the path to your front icon here.
echo '<link rel="Shortcut Icon" type="image/x-icon" href="' . $url . '" />';
}
}
add_action( 'wp_head', 'custom_default_favicon' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment