Skip to content

Instantly share code, notes, and snippets.

@johnregan3
Last active November 1, 2017 22:06
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save johnregan3/7a1f8c596546c953d286 to your computer and use it in GitHub Desktop.
Filter to add a custom favicon to your Genesis child theme.
<?php
/**
* Add custom Genesis favicon
*
* Dude, replace the default Genesis favicon so you don't look like a n00b.
* Create your custom favicon.ico and place it in your child theme's directory.
* Add this code to your child theme's functions.php
*
* Images can be converted to the .ico format here: http://www.favicon-generator.org/
*
* @author John Regan (john@johnregan3.com)
* @filter genesis_pre_load_favicon
* @uses get_stylesheet_directory_uri
* @param string Default Genesis favicon URL
* @return string Custom favicon URL
*/
add_filter( 'genesis_pre_load_favicon', 'my_custom_favicon' );
function my_custom_favicon( $favicon_url ) {
return get_stylesheet_directory() . '/favicon.ico';
}
@anwerashif
Copy link

return get_stylesheet_directory_uri() . '/favicon.ico' ;

Hope, you will update soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment