An updated theme (based on Atticus Finch) for ClassicPress
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.1 KiB

3 years ago
3 years ago
  1. /**
  2. * customizer.js
  3. *
  4. * Theme Customizer enhancements for a better user experience.
  5. *
  6. * Contains handlers to make Theme Customizer preview reload changes asynchronously.
  7. */
  8. ( function( $ ) {
  9. // Site title and description.
  10. wp.customize( 'blogname', function( value ) {
  11. value.bind( function( to ) {
  12. $( '.site-title a' ).text( to );
  13. } );
  14. } );
  15. wp.customize( 'blogdescription', function( value ) {
  16. value.bind( function( to ) {
  17. $( '.site-description' ).text( to );
  18. } );
  19. } );
  20. // Header text color.
  21. wp.customize( 'header_textcolor', function( value ) {
  22. value.bind( function( to ) {
  23. if ( 'blank' === to ) {
  24. $( '.site-title, .site-description' ).css( {
  25. 'clip': 'rect(1px, 1px, 1px, 1px)',
  26. 'position': 'absolute'
  27. } );
  28. } else {
  29. $( '.site-title, .site-description' ).css( {
  30. 'clip': 'auto',
  31. 'color': to,
  32. 'position': 'relative'
  33. } );
  34. }
  35. } );
  36. } );
  37. // Social Media Options
  38. wp.customize( 'portage_twitter', function( value ) {
  39. value.bind( function( to ) {
  40. $( '#social-media-menu' ).text( to );
  41. } );
  42. } );
  43. } )( jQuery );