Skip to content

Instantly share code, notes, and snippets.

@jester1979
Created January 27, 2015 20:24
Show Gist options
  • Save jester1979/98fdbc2a770c8297eb72 to your computer and use it in GitHub Desktop.
Save jester1979/98fdbc2a770c8297eb72 to your computer and use it in GitHub Desktop.
Favicon URL in multisite
add_filter( 'genesis_favicon_url', 'customize_favicon_url' );
/**
* Change location of favicon reference.
*
* @since 1.0.0
*
* @global int $blog_id Current blog ID.
*
* @return string Updated favicon URL.
*/
function customize_favicon_url() {
if ( ! is_multisite() ) {
$favicon = CHILD_URL . '/images/favicon.ico';
} else {
global $blog_id;
$favicon = CHILD_URL . '/images/favicon-' . $blog_id . '.ico';
}
return esc_url( $favicon );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment