summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'themes/twentyfifteen/inc/custom-header.php')
-rw-r--r--themes/twentyfifteen/inc/custom-header.php70
1 files changed, 31 insertions, 39 deletions
diff --git a/themes/twentyfifteen/inc/custom-header.php b/themes/twentyfifteen/inc/custom-header.php
index 5f90789f..10d0ef1a 100644
--- a/themes/twentyfifteen/inc/custom-header.php
+++ b/themes/twentyfifteen/inc/custom-header.php
@@ -13,8 +13,8 @@
* @uses twentyfifteen_header_style()
*/
function twentyfifteen_custom_header_setup() {
- $color_scheme = twentyfifteen_get_color_scheme();
- $default_text_color = trim( $color_scheme[4], '#' );
+ $color_scheme = twentyfifteen_get_color_scheme();
+ $default_text_color = trim( $color_scheme[4], '#' );
/**
* Filter Twenty Fifteen custom-header support arguments.
@@ -31,16 +31,12 @@ function twentyfifteen_custom_header_setup() {
* displayed on the blog.
* }
*/
- add_theme_support(
- 'custom-header', apply_filters(
- 'twentyfifteen_custom_header_args', array(
- 'default-text-color' => $default_text_color,
- 'width' => 954,
- 'height' => 1300,
- 'wp-head-callback' => 'twentyfifteen_header_style',
- )
- )
- );
+ add_theme_support( 'custom-header', apply_filters( 'twentyfifteen_custom_header_args', array(
+ 'default-text-color' => $default_text_color,
+ 'width' => 954,
+ 'height' => 1300,
+ 'wp-head-callback' => 'twentyfifteen_header_style',
+ ) ) );
}
add_action( 'after_setup_theme', 'twentyfifteen_custom_header_setup' );
@@ -57,10 +53,10 @@ function twentyfifteen_hex2rgb( $color ) {
$color = trim( $color, '#' );
if ( strlen( $color ) == 3 ) {
- $r = hexdec( substr( $color, 0, 1 ) . substr( $color, 0, 1 ) );
- $g = hexdec( substr( $color, 1, 1 ) . substr( $color, 1, 1 ) );
- $b = hexdec( substr( $color, 2, 1 ) . substr( $color, 2, 1 ) );
- } elseif ( strlen( $color ) == 6 ) {
+ $r = hexdec( substr( $color, 0, 1 ).substr( $color, 0, 1 ) );
+ $g = hexdec( substr( $color, 1, 1 ).substr( $color, 1, 1 ) );
+ $b = hexdec( substr( $color, 2, 1 ).substr( $color, 2, 1 ) );
+ } else if ( strlen( $color ) == 6 ) {
$r = hexdec( substr( $color, 0, 2 ) );
$g = hexdec( substr( $color, 2, 2 ) );
$b = hexdec( substr( $color, 4, 2 ) );
@@ -68,33 +64,29 @@ function twentyfifteen_hex2rgb( $color ) {
return array();
}
- return array(
- 'red' => $r,
- 'green' => $g,
- 'blue' => $b,
- );
+ return array( 'red' => $r, 'green' => $g, 'blue' => $b );
}
if ( ! function_exists( 'twentyfifteen_header_style' ) ) :
- /**
- * Styles the header image and text displayed on the blog.
- *
- * @since Twenty Fifteen 1.0
- *
- * @see twentyfifteen_custom_header_setup()
- */
- function twentyfifteen_header_style() {
- $header_image = get_header_image();
+/**
+ * Styles the header image and text displayed on the blog.
+ *
+ * @since Twenty Fifteen 1.0
+ *
+ * @see twentyfifteen_custom_header_setup()
+ */
+function twentyfifteen_header_style() {
+ $header_image = get_header_image();
- // If no custom options for text are set, let's bail.
- if ( empty( $header_image ) && display_header_text() ) {
- return;
- }
+ // If no custom options for text are set, let's bail.
+ if ( empty( $header_image ) && display_header_text() ) {
+ return;
+ }
- // If we get this far, we have custom styles. Let's do this.
- ?>
- <style type="text/css" id="twentyfifteen-header-css">
- <?php
+ // If we get this far, we have custom styles. Let's do this.
+ ?>
+ <style type="text/css" id="twentyfifteen-header-css">
+ <?php
// Short header for when there is no Custom Header and Header Text is hidden.
if ( empty( $header_image ) && ! display_header_text() ) :
?>
@@ -190,7 +182,7 @@ if ( ! function_exists( 'twentyfifteen_header_style' ) ) :
<?php endif; ?>
</style>
<?php
- }
+}
endif; // twentyfifteen_header_style
/**