Skip to content

Instantly share code, notes, and snippets.

@cgrymala
Created February 13, 2015 14:36
Show Gist options
  • Save cgrymala/1f95156fdef411ca5437 to your computer and use it in GitHub Desktop.
Save cgrymala/1f95156fdef411ca5437 to your computer and use it in GitHub Desktop.
Allow JetPack to control your WordPress site's favicon instead of Genesis
<?php
/**
* The 'genesis_pre_load_favicon' filter runs at the beginning of the genesis_load_favicon() function.
* If the value returned by that filter ends up as anything except boolean false, Genesis bails on the
* genesis_load_favicon() process.
*/
add_filter( 'genesis_pre_load_favicon', 'check_jetpack_site_icon_status' );
function check_jetpack_site_icon_status() {
/**
* If the JetPack module is active and a JetPack Site Icon has been set,
* we'll return true. Otherwise, we return false, allowing Genesis
* to continue loading its favicon.
*/
return function_exists( 'jetpack_has_site_icon' ) && jetpack_has_site_icon();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment