How to display a custom favicon on Genesis Child Theme

8:27 AM 0 Comments

Today I am going to share how do you can change your website favicon which is appeared by Genesis Child Theme on WordPress. Genesis Framework or Genesis Child Theme bare default favicon icon with G written on a black circle. There is an ico formated file in images folder of your child theme directory. Just changed it with 16x16 resolution favicon.ico.





Here is the code to add in your functions.php file.


<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Display a custom favicon
add_filter( 'genesis_pre_load_favicon', 'sp_favicon_filter' );
function sp_favicon_filter( $favicon_url ) {
return 'http://www.mydomain.com/wp-content/themes/genesis/images/favicon.ico';
}

Millennial & an introvert. Totally dashing beyond Passion. Code is poetry that never lies. Facebook or Drop Mail