diff --git a/src/wp-content/themes/twentyeleven/functions.php b/src/wp-content/themes/twentyeleven/functions.php index 4c478fd8e3..3ca5da5882 100644 --- a/src/wp-content/themes/twentyeleven/functions.php +++ b/src/wp-content/themes/twentyeleven/functions.php @@ -440,6 +440,39 @@ if ( ! function_exists( 'twentyeleven_admin_header_image' ) ) : } endif; // twentyeleven_admin_header_image() + +if ( ! function_exists( 'twentyeleven_header_image' ) ) : + /** + * Custom header image markup displayed. + * + * @since Twenty Eleven 4.5 + */ + function twentyeleven_header_image() { + $attrs = array( + 'alt' => get_bloginfo( 'name', 'display' ), + ); + + // Compatibility with versions of WordPress prior to 3.4. + if ( function_exists( 'get_custom_header' ) ) { + $custom_header = get_custom_header(); + $attrs['width'] = $custom_header->width; + $attrs['height'] = $custom_header->height; + } else { + $attrs['width'] = HEADER_IMAGE_WIDTH; + $attrs['height'] = HEADER_IMAGE_HEIGHT; + } + + if ( function_exists( 'the_header_image_tag' ) ) { + the_header_image_tag( $attrs ); + return; + } + + ?> + <?php echo esc_attr( $attrs['alt'] ); ?> + ID, 'post-thumbnail' ); } else { - // Compatibility with versions of WordPress prior to 3.4. - if ( function_exists( 'get_custom_header' ) ) { - $header_image_width = get_custom_header()->width; - $header_image_height = get_custom_header()->height; - } else { - $header_image_width = HEADER_IMAGE_WIDTH; - $header_image_height = HEADER_IMAGE_HEIGHT; - } - ?> - <?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?> - diff --git a/src/wp-content/themes/twentyfourteen/header.php b/src/wp-content/themes/twentyfourteen/header.php index ad3e128b0c..10b31fbf36 100644 --- a/src/wp-content/themes/twentyfourteen/header.php +++ b/src/wp-content/themes/twentyfourteen/header.php @@ -36,7 +36,7 @@ diff --git a/src/wp-content/themes/twentyfourteen/inc/custom-header.php b/src/wp-content/themes/twentyfourteen/inc/custom-header.php index d6692dbb41..9b8f35d7ce 100644 --- a/src/wp-content/themes/twentyfourteen/inc/custom-header.php +++ b/src/wp-content/themes/twentyfourteen/inc/custom-header.php @@ -151,3 +151,29 @@ if ( ! function_exists( 'twentyfourteen_admin_header_image' ) ) : get_bloginfo( 'name', 'display' ), + 'height' => $custom_header->height, + 'width' => $custom_header->width, + ); + if ( function_exists( 'the_header_image_tag' ) ) { + the_header_image_tag( $attrs ); + return; + } + ?> + <?php echo esc_attr( $attrs['alt'] ); ?> +
- <?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?> + get_bloginfo( 'name', 'display' ), + 'sizes' => $custom_header_sizes, + 'height' => $custom_header->height, + 'width' => $custom_header->width, + ); + + the_header_image_tag( $attrs ); + ?>
diff --git a/src/wp-content/themes/twentyten/functions.php b/src/wp-content/themes/twentyten/functions.php index 36e20c442c..eb4fe64ef3 100644 --- a/src/wp-content/themes/twentyten/functions.php +++ b/src/wp-content/themes/twentyten/functions.php @@ -290,6 +290,39 @@ if ( ! function_exists( 'twentyten_admin_header_style' ) ) : } endif; + +if ( ! function_exists( 'twentyten_header_image' ) ) : + /** + * Custom header image markup displayed. + * + * @since Twenty Ten 4.0 + */ + function twentyten_header_image() { + $attrs = array( + 'alt' => get_bloginfo( 'name', 'display' ), + ); + + // Compatibility with versions of WordPress prior to 3.4. + if ( function_exists( 'get_custom_header' ) ) { + $custom_header = get_custom_header(); + $attrs['width'] = $custom_header->width; + $attrs['height'] = $custom_header->height; + } else { + $attrs['width'] = HEADER_IMAGE_WIDTH; + $attrs['height'] = HEADER_IMAGE_HEIGHT; + } + + if ( function_exists( 'the_header_image_tag' ) ) { + the_header_image_tag( $attrs ); + return; + } + + ?> + <?php echo esc_attr( $attrs['alt'] ); ?> + ID, 'post-thumbnail' ); } else { - // Compatibility with versions of WordPress prior to 3.4. - if ( function_exists( 'get_custom_header' ) ) { - $header_image_width = get_custom_header()->width; - $header_image_height = get_custom_header()->height; - } else { - $header_image_width = HEADER_IMAGE_WIDTH; - $header_image_height = HEADER_IMAGE_HEIGHT; - } - ?> - - diff --git a/src/wp-content/themes/twentytwelve/header.php b/src/wp-content/themes/twentytwelve/header.php index 0d4cf9441a..13fbebead9 100644 --- a/src/wp-content/themes/twentytwelve/header.php +++ b/src/wp-content/themes/twentytwelve/header.php @@ -54,7 +54,7 @@ - <?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?> + diff --git a/src/wp-content/themes/twentytwelve/inc/custom-header.php b/src/wp-content/themes/twentytwelve/inc/custom-header.php index 84b3556c24..a20df42367 100644 --- a/src/wp-content/themes/twentytwelve/inc/custom-header.php +++ b/src/wp-content/themes/twentytwelve/inc/custom-header.php @@ -166,3 +166,27 @@ function twentytwelve_admin_header_image() { get_bloginfo( 'name', 'display' ), + 'class' => 'header-image', + 'height' => $custom_header->height, + 'width' => $custom_header->width, + ); + + if ( function_exists( 'the_header_image_tag' ) ) { + the_header_image_tag( $attrs ); + return; + } + ?> + <?php echo esc_attr( $attrs['alt'] ); ?> +