ryu_get_default_header_image(), 'default-text-color' => '000', 'width' => 120, 'height' => 120, 'flex-width' => true, 'flex-height' => true, 'wp-head-callback' => 'ryu_header_style', 'admin-head-callback' => 'ryu_admin_header_style', 'admin-preview-callback' => 'ryu_admin_header_image', ) ) ); register_default_headers( array( 'gravatar' => array( 'url' => ryu_get_default_header_image(), 'thumbnail_url' => ryu_get_default_header_image(), 'description' => __( 'Your Gravatar', 'ryu' ) ), ) ); } add_action( 'after_setup_theme', 'ryu_custom_header_setup' ); /** * A default header image * * Use the admin email's gravatar as the default header image. */ function ryu_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 = ''; $protocol = ( is_ssl() ) ? 'https://secure.' : 'http://'; if ( ( get_option( 'admin_email' ) != get_theme_mod( 'gravatar_email' ) ) && is_email( get_theme_mod( 'gravatar_email' ) ) ) $email = get_theme_mod( 'gravatar_email' ); else $email = get_option( 'admin_email' ); $url = sprintf( '%1$sgravatar.com/avatar/%2$s/', $protocol, md5( $email ) ); $url = add_query_arg( array( 's' => 120, 'd' => urlencode( $default ), ), $url ); return esc_url_raw( $url ); } // ryu_get_default_header_image if ( ! function_exists( 'ryu_header_style' ) ) : /** * Styles the header image and text displayed on the blog * * @see ryu_custom_header_setup(). */ function ryu_header_style() { $header_text_color = get_header_textcolor(); // If no custom options for text are set, let's bail // get_header_textcolor() options: HEADER_TEXTCOLOR is default, hide text (returns 'blank') or any hex value if ( HEADER_TEXTCOLOR == $header_text_color ) return; // If we get this far, we have custom styles. Let's do this. ?> Header admin panel. * * @see ryu_custom_header_setup(). */ function ryu_admin_header_style() { ?> Header admin panel. * * @see ryu_custom_header_setup(). */ function ryu_admin_header_image() { $style = sprintf( ' style="color:#%s;"', get_header_textcolor() ); $header_image = get_header_image(); ?>

onclick="return false;" href="">

>