Last active
November 1, 2017 22:06
-
-
Save johnregan3/7a1f8c596546c953d286 to your computer and use it in GitHub Desktop.
Filter to add a custom favicon to your Genesis child theme.
This file contains hidden or 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
<?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 ([email protected]) | |
* @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'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
return get_stylesheet_directory_uri() . '/favicon.ico' ;
Hope, you will update soon.