Ticket #26338: 26338.diff
File 26338.diff, 6.5 KB (added by , 11 years ago) |
---|
-
wp-content/themes/twentyfourteen/inc/custom-header.php
18 18 */ 19 19 function twentyfourteen_custom_header_setup() { 20 20 add_theme_support( 'custom-header', apply_filters( 'twentyfourteen_custom_header_args', array( 21 ' header-text' => false,21 'default-text-color' => 'fff', 22 22 'width' => 1260, 23 23 'height' => 240, 24 24 'flex-height' => true, 25 'wp-head-callback' => 'twentyfourteen_header_style', 25 26 'admin-head-callback' => 'twentyfourteen_admin_header_style', 26 27 'admin-preview-callback' => 'twentyfourteen_admin_header_image', 27 28 ) ) ); 28 29 } 29 30 add_action( 'after_setup_theme', 'twentyfourteen_custom_header_setup' ); 30 31 32 if ( ! function_exists( 'twentyfourteen_header_style' ) ) : 33 /** 34 * Styles the header image and text displayed on the blog 35 * 36 * @see twentyfourteen_custom_header_setup(). 37 * 38 */ 39 function twentyfourteen_header_style() { 40 $header_text_color = get_header_textcolor(); 41 42 // If no custom options for text are set, let's bail 43 // $header_text_color options: HEADER_TEXTCOLOR is default, hide text (returns 'blank') or any hex value 44 if ( HEADER_TEXTCOLOR == $header_text_color ) 45 return; 46 // If we get this far, we have custom styles. Let's do this. 47 ?> 48 <style type="text/css"> 49 <?php 50 // Has the text been hidden? 51 if ( 'blank' == $header_text_color ) : 52 ?> 53 .site-title { 54 position: absolute !important; 55 clip: rect(1px 1px 1px 1px); /* IE6, IE7 */ 56 clip: rect(1px, 1px, 1px, 1px); 57 } 58 <?php 59 // If the user has set a custom color for the text use that 60 else : 61 ?> 62 .site-title a { 63 color: #<?php echo $header_text_color; ?> !important; 64 } 65 <?php endif; ?> 66 </style> 67 <?php 68 } 69 endif; // twentyfourteen_header_style 70 71 31 72 if ( ! function_exists( 'twentyfourteen_admin_header_style' ) ) : 32 73 /** 33 74 * Style the header image displayed on the Appearance > Header admin panel. … … 42 83 .appearance_page_custom-header #headimg { 43 84 background-color: #000; 44 85 border: none; 45 max-width: 12 30px;86 max-width: 1260px; 46 87 min-height: 48px; 47 88 } 48 89 #headimg h1 { 49 font-family: lato, sans-serif;90 font-family: Lato, sans-serif; 50 91 font-size: 18px; 51 line-height: 1.3333333333;52 margin: 12px 0 12px 27px;92 line-height: 48px; 93 margin: 0 0 0 30px; 53 94 } 54 95 #headimg h1 a { 55 96 color: #fff; … … 77 118 <?php if ( get_header_image() ) : ?> 78 119 <img src="<?php header_image(); ?>" alt=""> 79 120 <?php endif; ?> 80 <h1 ><a id="name"onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?></a></h1>121 <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> 81 122 </div> 82 123 <?php 83 124 } -
wp-content/themes/twentyfourteen/inc/customizer.php
16 16 */ 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'; 21 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 ) ) ); 36 22 37 // Add custom description to Colors and Background sections. 23 38 $wp_customize->get_section( 'colors' )->description = __( 'Background may only be visible on wide screens.', 'twentyfourteen' ); 24 39 $wp_customize->get_section( 'background_image' )->description = __( 'Background may only be visible on wide screens.', 'twentyfourteen' ); … … 67 82 * @since Twenty Fourteen 1.0 68 83 */ 69 84 function twentyfourteen_customize_preview_js() { 70 wp_enqueue_script( 'twentyfourteen_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '201 20827', true );85 wp_enqueue_script( 'twentyfourteen_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20131130', true ); 71 86 } 72 87 add_action( 'customize_preview_init', 'twentyfourteen_customize_preview_js' ); 73 88 -
wp-content/themes/twentyfourteen/js/customizer.js
15 15 $( '.site-description' ).text( to ); 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 ); 39 No newline at end of file -
wp-content/themes/twentyfourteen/style.css
3544 3544 margin: -3px 0 21px; 3545 3545 } 3546 3546 3547 .site-description:empty { 3548 margin: 0; 3549 } 3550 3547 3551 .secondary-navigation { 3548 3552 margin: 0 -30px 48px; 3549 3553 width: 182px;