Created
September 14, 2013 15:30
-
-
Save ZellSnippets/6562944 to your computer and use it in GitHub Desktop.
PHP: Genesis: Change favicon paths
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_pre_load_favicon', 'zell_load_favicon'); | |
function zell_load_favicons() { | |
$favicon_path = get_stylesheet_directory_uri(). | |
'/images/favicons'; | |
// Use a 144px X 144px PNG for the latest iOS devices | |
echo '<link rel="apple-touch-icon" href="'.$favicon_path. | |
'/favicon-144.png">'; | |
// Alternative: tell iOS not to gloss your icon | |
// echo '<link rel="apple-touch-icon-precomposed" href="' . $favicon_path . '/favicon-144.png">'; | |
// Use a 96px X 96px PNG for modern desktop browsers | |
echo '<link rel="icon" href="'.$favicon_path. | |
'/favicon-96.png">'; | |
// Give IE <= 9 the old favicon.ico (16px X 16px) | |
echo '<!--[if IE]><link rel="shortcut icon" href="'.$favicon_path. | |
'/favicon.ico"><![endif]-->'; | |
// Use a 144px X 144px PNG for Windows tablets | |
echo '<meta name="msapplication-TileImage" content="'.$favicon_path. | |
'/favicon-144.png">'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment