mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-01 21:21:24 +01:00
Twenty Twelve: enable live preview for Header Text Color in Theme Customizer. Change also removes an !important
declaration (yay) in Custom Header CSS rules.
Props SriniG, fixes #23600. git-svn-id: http://core.svn.wordpress.org/trunk@23572 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4847fe6efc
commit
76e80eaa86
@ -437,8 +437,9 @@ add_action( 'template_redirect', 'twentytwelve_content_width' );
|
||||
* @return void
|
||||
*/
|
||||
function twentytwelve_customize_register( $wp_customize ) {
|
||||
$wp_customize->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';
|
||||
}
|
||||
add_action( 'customize_register', 'twentytwelve_customize_register' );
|
||||
|
||||
|
@ -77,9 +77,9 @@ function twentytwelve_header_style() {
|
||||
// If the user has set a custom color for the text, use that.
|
||||
else :
|
||||
?>
|
||||
.site-title a,
|
||||
.site-description {
|
||||
color: #<?php echo $text_color; ?> !important;
|
||||
.site-header h1 a,
|
||||
.site-header h2 {
|
||||
color: #<?php echo $text_color; ?>;
|
||||
}
|
||||
<?php endif; ?>
|
||||
</style>
|
||||
|
@ -17,6 +17,12 @@
|
||||
$( '.site-description' ).text( to );
|
||||
} );
|
||||
} );
|
||||
// Header text color
|
||||
wp.customize( 'header_textcolor', function( value ) {
|
||||
value.bind( function( to ) {
|
||||
$( '.site-title a, .site-description' ).css( 'color', to );
|
||||
} );
|
||||
} );
|
||||
|
||||
// Hook into background color/image change and adjust body class value as needed.
|
||||
wp.customize( 'background_color', function( value ) {
|
||||
|
Loading…
Reference in New Issue
Block a user