Created
January 27, 2015 20:24
-
-
Save jester1979/98fdbc2a770c8297eb72 to your computer and use it in GitHub Desktop.
Favicon URL in multisite
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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