Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

@anwerashif anwerashif commented Nov 1, 2017

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