Created
March 15, 2014 00:32
-
-
Save bhwebworks/9559948 to your computer and use it in GitHub Desktop.
Code to remove from Sixteen Nine Pro functions.php to remove the avatar image from the site header
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* 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