This is the forth of the four methods to change the default Genesis favicon for a WordPress Genesis theme. In Method 4 you need to modify the functions.php of your child’s theme. You should always make a copy of your child theme’s functions.php before you make any changes. Should you have a problem all you need to do is use an FTP program and upload the orginal file under the child theme’s folder.
- Open the Editor on the dashboard in your WordPress Admin
- Open your Genesis Child Theme’s function.php.
- Add the following script at the bottom of the page. Replace the ‘www.yourdomain.com/’ with your own domain & replace image_path your path to the favicon.
// Loads favicon from specified URL add_filter( 'genesis_pre_load_favicon', 'cd_favicon' ); function cd_favicon( $myfavicon) { //replace this with the path of your favicon file $myfavicon = 'http://www.yourdomain.com/image_path/favicon.ico'; return $myfavicon; }
Make sure you save the file!
It might take a while to show or you may have to clear your browser’s cache.
That’s it!