Skip to content

Instantly share code, notes, and snippets.

@WebEndevSnippets
Created January 2, 2013 16:14
Show Gist options
  • Save WebEndevSnippets/4435705 to your computer and use it in GitHub Desktop.
Save WebEndevSnippets/4435705 to your computer and use it in GitHub Desktop.
WordPress: Change Admin Favicon
add_action( 'admin_head', 'we_admin_favicon' );
/**
* Change Admin Favicon
*
*/
function we_admin_favicon() {
if ( file_exists( CHILD_DIR . '/images/favicon.ico' ) )
$favicon = CHILD_URL . '/images/favicon.ico';
elseif ( file_exists( CHILD_DIR . '/images/favicon.gif' ) )
$favicon = CHILD_URL . '/images/favicon.gif';
elseif ( file_exists( CHILD_DIR . '/images/favicon.png' ) )
$favicon = CHILD_URL . '/images/favicon.png';
elseif ( file_exists( CHILD_DIR . '/images/favicon.jpg' ) )
$favicon = CHILD_URL . '/images/favicon.jpg';
else
$favicon = PARENT_URL . '/images/favicon.ico';
$favicon = apply_filters( 'genesis_favicon_url', $favicon );
if ( $favicon )
echo '<link rel="Shortcut Icon" href="' . esc_url( $favicon ) . '" type="image/x-icon" />' . "\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment