Skip to content

Instantly share code, notes, and snippets.

@menslow
Last active August 29, 2015 14:07
Show Gist options
  • Save menslow/506ca7e50a6d0fb82aaf to your computer and use it in GitHub Desktop.
Save menslow/506ca7e50a6d0fb82aaf to your computer and use it in GitHub Desktop.
Genesis Filter for customizing favicons and Apple Touch icons
<?php
// Filter for Genesis Parent theme to Customize favicon and add Apple Touch Icons
add_filter( 'genesis_pre_load_favicon', 'my_pre_load_favicon');
function my_pre_load_favicon() {
echo '<link rel="shortcut icon" href="' . get_stylesheet_directory_uri() . '/lib/images/favicon.ico">'.PHP_EOL
.'<link rel="apple-touch-icon" href="touch-icon-iphone.png">'.PHP_EOL
.'<link rel="apple-touch-icon" sizes="76x76" href="' . get_stylesheet_directory_uri() . '/lib/images/logo-76.png">'.PHP_EOL
.'<link rel="apple-touch-icon" sizes="120x120" href="' . get_stylesheet_directory_uri() . '/lib/images/[email protected]">'.PHP_EOL
.'<link rel="apple-touch-icon" sizes="152x152" href="' . get_stylesheet_directory_uri() . '/lib/images/[email protected]">';
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment