Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Fitler for title and small js for faster live preview
- Loading branch information
Showing
3 changed files
with
91 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* Theme Customizer enhancements for a better user experience. | ||
* | ||
* Contains handlers to make Theme Customizer preview reload changes asynchronously. | ||
* Things like site title, description, and background color changes. | ||
*/ | ||
|
||
( function( $ ) { | ||
// Site title and description. | ||
wp.customize( 'blogname', function( value ) { | ||
value.bind( function( to ) { | ||
$( '#header h1' ).html( to ); | ||
} ); | ||
} ); | ||
wp.customize( 'blogdescription', function( value ) { | ||
value.bind( function( to ) { | ||
$( '.site-description' ).html( to ); | ||
} ); | ||
} ); | ||
|
||
// Hook into background color change and adjust body class value as needed. | ||
wp.customize( 'background_color', function( value ) { | ||
value.bind( function( to ) { | ||
if ( '#ffffff' == to || '#fff' == to || '' == to ) | ||
$( 'body' ).addClass( 'custom-background-white' ); | ||
else if ( '' == to ) | ||
$( 'body' ).addClass( 'custom-background-empty' ); | ||
else | ||
$( 'body' ).removeClass( 'custom-background-empty custom-background-white' ); | ||
} ); | ||
} ); | ||
} )( jQuery ); |