'', 'default-image' => accessiblezen_get_default_header_image(), 'header-text' => false, 'uploads' => true, // Set height and width, with a maximum value for the width. 'height' => 150, 'width' => 150, // Add flex height and width. 'flex-width' => true, 'flex-height' => true, // Callbacks for styling the header and the admin preview. 'wp-head-callback' => '', 'admin-head-callback' => '', 'admin-preview-callback' => '', ); add_theme_support( 'custom-header', $args ); } add_action( 'after_setup_theme', 'accessiblezen_custom_header_setup' ); /** * A default header image * * Use the admin email's gravatar as the default header image. * Thanks Konstantin Kovshenin and the Publish theme! * * @since accessiblezen 1.0 */ function accessiblezen_get_default_header_image() { // Get default from Discussion Settings. $default = get_option( 'avatar_default', 'mystery' ); // Mystery man default if ( 'mystery' == $default ) $default = 'mm'; elseif ( 'gravatar_default' == $default ) $default = ''; $url = ( is_ssl() ) ? 'https://secure.gravatar.com' : 'http://gravatar.com'; $url .= sprintf( '/avatar/%s/', md5( get_option( 'admin_email' ) ) ); $url = add_query_arg( array( 's' => 150, 'd' => urlencode( $default ), ), $url ); return esc_url_raw( $url ); } // accessiblezen_get_default_header_image