Changeset 26573
- Timestamp:
- 12/03/2013 06:26:26 PM (11 years ago)
- Location:
- trunk/src/wp-content/themes/twentyfourteen
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentyfourteen/inc/custom-header.php
r26556 r26573 37 37 */ 38 38 add_theme_support( 'custom-header', apply_filters( 'twentyfourteen_custom_header_args', array( 39 ' header-text' => false,39 'default-text-color' => 'fff', 40 40 'width' => 1260, 41 41 'height' => 240, 42 42 'flex-height' => true, 43 'wp-head-callback' => 'twentyfourteen_header_style', 43 44 'admin-head-callback' => 'twentyfourteen_admin_header_style', 44 45 'admin-preview-callback' => 'twentyfourteen_admin_header_image', … … 46 47 } 47 48 add_action( 'after_setup_theme', 'twentyfourteen_custom_header_setup' ); 49 50 if ( ! function_exists( 'twentyfourteen_header_style' ) ) : 51 /** 52 * Styles the header image and text displayed on the blog 53 * 54 * @see twentyfourteen_custom_header_setup(). 55 * 56 */ 57 function twentyfourteen_header_style() { 58 $header_text_color = get_header_textcolor(); 59 60 // If no custom options for text are set, let's bail 61 // $header_text_color options: HEADER_TEXTCOLOR is default, hide text (returns 'blank') or any hex value 62 if ( HEADER_TEXTCOLOR == $header_text_color ) 63 return; 64 // If we get this far, we have custom styles. Let's do this. 65 ?> 66 <style type="text/css"> 67 <?php 68 // Has the text been hidden? 69 if ( 'blank' == $header_text_color ) : 70 ?> 71 .site-title { 72 position: absolute !important; 73 clip: rect(1px 1px 1px 1px); /* IE6, IE7 */ 74 clip: rect(1px, 1px, 1px, 1px); 75 } 76 <?php 77 // If the user has set a custom color for the text use that 78 else : 79 ?> 80 .site-title a { 81 color: #<?php echo $header_text_color; ?> !important; 82 } 83 <?php endif; ?> 84 </style> 85 <?php 86 } 87 endif; // twentyfourteen_header_style 88 48 89 49 90 if ( ! function_exists( 'twentyfourteen_admin_header_style' ) ) : … … 61 102 background-color: #000; 62 103 border: none; 63 max-width: 12 30px;104 max-width: 1260px; 64 105 min-height: 48px; 65 106 } 66 107 #headimg h1 { 67 font-family: lato, sans-serif;108 font-family: Lato, sans-serif; 68 109 font-size: 18px; 69 line-height: 1.3333333333;70 margin: 12px 0 12px 27px;110 line-height: 48px; 111 margin: 0 0 0 30px; 71 112 } 72 113 #headimg h1 a { … … 96 137 <img src="<?php header_image(); ?>" alt=""> 97 138 <?php endif; ?> 98 <h1 ><a id="name"onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?></a></h1>139 <h1 class="displaying-header-text"><a id="name"<?php echo sprintf( ' style="color:#%s;"', get_header_textcolor() ); ?> onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?></a></h1> 99 140 </div> 100 141 <?php -
trunk/src/wp-content/themes/twentyfourteen/inc/customizer.php
r26567 r26573 17 17 function twentyfourteen_customize_register( $wp_customize ) { 18 18 // Add postMessage support for site title and description. 19 $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; 20 $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; 19 $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; 20 $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; 21 $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; 22 23 // Rename the label to "Display Site Title & Tagline" in order to make this option extra clear. 24 $wp_customize->add_control( 'display_header_text', array( 25 'settings' => 'header_textcolor', 26 'label' => __( 'Display Site Title & Tagline', 'twentyfourteen' ), 27 'section' => 'title_tagline', 28 'type' => 'checkbox', 29 ) ); 30 31 // Rename the label to "Site Title Color" because this only effects the site title in this theme. 32 $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'header_textcolor', array( 33 'label' => __( 'Site Title Color', 'twentyfourteen' ), 34 'section' => 'colors', 35 ) ) ); 21 36 22 37 // Add custom description to Colors and Background sections. … … 54 69 */ 55 70 function twentyfourteen_customize_preview_js() { 56 wp_enqueue_script( 'twentyfourteen_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '201 20827', true );71 wp_enqueue_script( 'twentyfourteen_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20131130', true ); 57 72 } 58 73 add_action( 'customize_preview_init', 'twentyfourteen_customize_preview_js' ); -
trunk/src/wp-content/themes/twentyfourteen/js/customizer.js
r26332 r26573 16 16 } ); 17 17 } ); 18 // Header text color. 19 wp.customize( 'header_textcolor', function( value ) { 20 value.bind( function( to ) { 21 if ( 'blank' == to ) { 22 $( '.site-title a, .site-description' ).css( { 23 'clip': 'rect(1px, 1px, 1px, 1px)', 24 'position': 'absolute' 25 } ); 26 } else { 27 $( '.site-title a, .site-description' ).css( { 28 'clip': 'auto', 29 'position': 'relative' 30 } ); 31 32 $( '.site-title a' ).css( { 33 'color': to, 34 } ); 35 } 36 } ); 37 } ); 18 38 } )( jQuery ); -
trunk/src/wp-content/themes/twentyfourteen/style.css
r26569 r26573 3558 3558 } 3559 3559 3560 .site-description:empty { 3561 margin: 0; 3562 } 3563 3560 3564 .secondary-navigation { 3561 3565 margin: 0 -30px 48px;
Note: See TracChangeset
for help on using the changeset viewer.