Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Code to remove from Sixteen Nine Pro functions.php to remove the avatar image from the site header
//* Add support for custom header
add_theme_support( 'custom-header', array(
'admin-preview-callback' => 'sixteen_nine_admin_header_callback',
'default-text-color' => 'ffffff',
'header-selector' => '.site-header .site-avatar img',
'height' => 224,
'width' => 224,
'wp-head-callback' => '__return_false',
) );
function sixteen_nine_admin_header_callback() {
echo get_header_image() ? '<img src="' . get_header_image() . '" />' : get_avatar( get_option( 'admin_email' ), 224 );
}
//* Hook site avatar before site title
add_action( 'genesis_header', 'sixteen_nine_site_gravatar', 5 );
function sixteen_nine_site_gravatar() {
$header_image = get_header_image() ? '<img alt="" src="' . get_header_image() . '" />' : get_avatar( get_option( 'admin_email' ), 224 );
printf( '<div class="site-avatar"><a href="%s">%s</a></div>', home_url( '/' ), $header_image );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.