diff --git a/wp-content/themes/twentyfourteen/inc/custom-header.php b/wp-content/themes/twentyfourteen/inc/custom-header.php
index 0c7efa403f..6b703d810d 100644
--- a/wp-content/themes/twentyfourteen/inc/custom-header.php
+++ b/wp-content/themes/twentyfourteen/inc/custom-header.php
@@ -36,16 +36,57 @@ function twentyfourteen_custom_header_setup() {
* }
*/
add_theme_support( 'custom-header', apply_filters( 'twentyfourteen_custom_header_args', array(
- 'header-text' => false,
+ 'default-text-color' => 'fff',
'width' => 1260,
'height' => 240,
'flex-height' => true,
+ 'wp-head-callback' => 'twentyfourteen_header_style',
'admin-head-callback' => 'twentyfourteen_admin_header_style',
'admin-preview-callback' => 'twentyfourteen_admin_header_image',
) ) );
}
add_action( 'after_setup_theme', 'twentyfourteen_custom_header_setup' );
+if ( ! function_exists( 'twentyfourteen_header_style' ) ) :
+/**
+ * Styles the header image and text displayed on the blog
+ *
+ * @see twentyfourteen_custom_header_setup().
+ *
+ */
+function twentyfourteen_header_style() {
+ $header_text_color = get_header_textcolor();
+
+ // If no custom options for text are set, let's bail
+ // $header_text_color 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 screen.
@@ -60,14 +101,14 @@ function twentyfourteen_admin_header_style() {
.appearance_page_custom-header #headimg {
background-color: #000;
border: none;
- max-width: 1230px;
+ max-width: 1260px;
min-height: 48px;
}
#headimg h1 {
- font-family: lato, sans-serif;
+ font-family: Lato, sans-serif;
font-size: 18px;
- line-height: 1.3333333333;
- margin: 12px 0 12px 27px;
+ line-height: 48px;
+ margin: 0 0 0 30px;
}
#headimg h1 a {
color: #fff;
@@ -95,7 +136,7 @@ function twentyfourteen_admin_header_image() {
-
+
get_setting( 'blogname' )->transport = 'postMessage';
- $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
+ $wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
+ $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
+ $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
+
+ // Rename the label to "Display Site Title & Tagline" in order to make this option extra clear.
+ $wp_customize->add_control( 'display_header_text', array(
+ 'settings' => 'header_textcolor',
+ 'label' => __( 'Display Site Title & Tagline', 'twentyfourteen' ),
+ 'section' => 'title_tagline',
+ 'type' => 'checkbox',
+ ) );
+
+ // Rename the label to "Site Title Color" because this only effects the site title in this theme.
+ $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'header_textcolor', array(
+ 'label' => __( 'Site Title Color', 'twentyfourteen' ),
+ 'section' => 'colors',
+ ) ) );
// Add custom description to Colors and Background sections.
$wp_customize->get_section( 'colors' )->description = __( 'Background may only be visible on wide screens.', 'twentyfourteen' );
@@ -53,7 +68,7 @@ add_action( 'customize_register', 'twentyfourteen_customize_register' );
* @since Twenty Fourteen 1.0
*/
function twentyfourteen_customize_preview_js() {
- wp_enqueue_script( 'twentyfourteen_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20120827', true );
+ wp_enqueue_script( 'twentyfourteen_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20131130', true );
}
add_action( 'customize_preview_init', 'twentyfourteen_customize_preview_js' );
diff --git a/wp-content/themes/twentyfourteen/js/customizer.js b/wp-content/themes/twentyfourteen/js/customizer.js
index acfb5e21bd..6c1df9314e 100644
--- a/wp-content/themes/twentyfourteen/js/customizer.js
+++ b/wp-content/themes/twentyfourteen/js/customizer.js
@@ -15,4 +15,24 @@
$( '.site-description' ).text( to );
} );
} );
+ // Header text color.
+ wp.customize( 'header_textcolor', function( value ) {
+ value.bind( function( to ) {
+ if ( 'blank' == to ) {
+ $( '.site-title a, .site-description' ).css( {
+ 'clip': 'rect(1px, 1px, 1px, 1px)',
+ 'position': 'absolute'
+ } );
+ } else {
+ $( '.site-title a, .site-description' ).css( {
+ 'clip': 'auto',
+ 'position': 'relative'
+ } );
+
+ $( '.site-title a' ).css( {
+ 'color': to,
+ } );
+ }
+ } );
+ } );
} )( jQuery );
\ No newline at end of file
diff --git a/wp-content/themes/twentyfourteen/style.css b/wp-content/themes/twentyfourteen/style.css
index e59b55fed4..87dece3ca1 100644
--- a/wp-content/themes/twentyfourteen/style.css
+++ b/wp-content/themes/twentyfourteen/style.css
@@ -3557,6 +3557,10 @@ a.post-thumbnail:hover {
margin: -3px 0 21px;
}
+ .site-description:empty {
+ margin: 0;
+ }
+
.secondary-navigation {
margin: 0 -30px 48px;
width: 182px;