Created
January 10, 2018 09:44
-
-
Save mbrughi/6ffc8ee581e9dbf2732edff9794a870b to your computer and use it in GitHub Desktop.
Display your own Favicon in Genesis Child Themes.
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
/** Adding My custom Favicon | |
* (change www.mywebsite.com with your website url) | |
*/ | |
add_filter( 'genesis_pre_load_favicon', 'my_custom_favicon' ); | |
function my_custom_favicon( $favicon_url ) { | |
return 'http://www.mywebsite.com/images/favicon.png'; | |
} | |
// or better use relative URL | |
/** Adding My custom Favicon | |
* (change child-theme-name with your child theme name) | |
*/ | |
add_filter( 'genesis_pre_load_favicon', 'my_custom_favicon' ); | |
function my_custom_favicon( $favicon_url ) { | |
return ''. trailingslashit( get_bloginfo('url') ) .'/wp-content/themes/child-theme-name/images/favicon.png'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment