/** * Theme Customizer enhancements for a better user experience. * * Contains handlers to make Theme Customizer preview reload changes asynchronously. */ jQuery(document).ready(function($) { // Site title and description. wp.customize('blogname', function(value) { value.bind(function(to) { $('.site-title a').text(to); }); }); wp.customize('blogdescription', function(value) { value.bind(function(to) { $('.site-description').text(to); }); }); wp.customize('facebook_link_url', function(value) { value.bind(function(to) { $('.bizpress-fb a').attr('href', to); }); }); wp.customize('twitter_link_url', function(value) { value.bind(function(to) { $('.social-links .bizpress-twitter a').attr('href', to); }); }); wp.customize('googleplus_link_url', function(value) { value.bind(function(to) { $('.social-links .bizpress-gplus a').attr('href', to); }); }); wp.customize('pinterest_link_url', function(value) { value.bind(function(to) { $('.social-links .bizpress-pinterest a').attr('href', to); }); }); wp.customize('github_link_url', function(value) { value.bind(function(to) { $('.social-links .bizpress-github a').attr('href', to); }); }); wp.customize('youtube_link_url', function(value) { value.bind(function(to) { $('.social-links .bizpress-youtube a').attr('href', to); }); }); wp.customize('call_button_text', function(value) { value.bind(function(to) { $('.call-button span').text(to); }); }); wp.customize('call_button_contact', function(value) { value.bind(function(to) { $('.call-button').attr('href', to); }); }); wp.customize('header_contact_phone', function(value) { value.bind(function(to) { $('.header-extras #phone').text(to); }); }); wp.customize('header_contact_address', function(value) { value.bind(function(to) { $('.header-extras #address').text(to); }); }); wp.customize('slider_one', function(value) { value.bind(function(to) { $('#slider1 img').attr('src', to); }); }); wp.customize('slider_title_one', function(value) { value.bind(function(to) { $('#slider1 .flex-caption h2').text(to); }); }); wp.customize('slider_one_link_url', function(value) { value.bind(function(to) { $('#slider1 > a').attr('href', to); }); }); wp.customize('slider_two', function(value) { value.bind(function(to) { $('#slider2 img').attr('src', to); }); }); wp.customize('slider_title_two', function(value) { value.bind(function(to) { $('#slider2 .flex-caption h2').text(to); }); }); wp.customize('slider_two_link_url', function(value) { value.bind(function(to) { $('#slider2 > a').attr('href', to); }); }); wp.customize('slider_three', function(value) { value.bind(function(to) { $('#slider3 img').attr('src', to); }); }); wp.customize('slider_title_three', function(value) { value.bind(function(to) { $('#slider3 .flex-caption h2').text(to); }); }); wp.customize('slider_three_link_url', function(value) { value.bind(function(to) { $('#slider3 > a').attr('href', to); }); }); wp.customize('tagline_title', function(value) { value.bind(function(to) { $('.business-tagline h3').text(to); }); }); wp.customize('tagline_description', function(value) { value.bind(function(to) { $('.business-tagline p').text(to); }); }); wp.customize('home_featured_one', function(value) { value.bind(function(to) { $('.home-featured-one .featured .featured-image img').attr('src', to); }); }); wp.customize('home_title_one', function(value) { value.bind(function(to) { $('.home-featured-one h3').text(to); }); }); wp.customize('home_description_one', function(value) { value.bind(function(to) { $('.home-featured-one p').text(to); }); }); wp.customize('home_one_link_url', function(value) { value.bind(function(to) { $('.home-featured-one .read-more').attr('href', to); }); }); wp.customize('home_one_link_text', function(value) { value.bind(function(to) { $('.home-featured-one .read-more').text(to); }); }); wp.customize('home_featured_two', function(value) { value.bind(function(to) { $('.home-featured-two img').attr('src', to); }); }); wp.customize('home_title_two', function(value) { value.bind(function(to) { $('.home-featured-two h3').text(to); }); }); wp.customize('home_description_two', function(value) { value.bind(function(to) { $('.home-featured-two p').text(to); }); }); wp.customize('home_two_link_url', function(value) { value.bind(function(to) { $('.home-featured-two .read-more').attr('href', to); }); }); wp.customize('home_two_link_text', function(value) { value.bind(function(to) { $('.home-featured-two .read-more').text(to); }); }); wp.customize('home_featured_three', function(value) { value.bind(function(to) { $('.home-featured-three img').attr('src', to); }); }); wp.customize('home_title_three', function(value) { value.bind(function(to) { $('.home-featured-three h3').text(to); }); }); wp.customize('home_description_three', function(value) { value.bind(function(to) { $('.home-featured-three p').text(to); }); }); wp.customize('home_three_link_url', function(value) { value.bind(function(to) { $('.home-featured-three .read-more').attr('href', to); }); }); wp.customize('home_three_link_text', function(value) { value.bind(function(to) { $('.home-featured-three .read-more').text(to); }); }); wp.customize('home_featured_four', function(value) { value.bind(function(to) { $('.home-featured-four img').attr('src', to); }); }); wp.customize('home_title_four', function(value) { value.bind(function(to) { $('.home-featured-four h3').text(to); }); }); wp.customize('home_description_four', function(value) { value.bind(function(to) { $('.home-featured-four p').text(to); }); }); wp.customize('home_four_link_url', function(value) { value.bind(function(to) { $('.home-featured-four .read-more').attr('href', to); }); }); wp.customize('home_four_link_text', function(value) { value.bind(function(to) { $('.home-featured-four .read-more').text(to); }); }); wp.customize('testimonial_title', function(value) { value.bind(function(to) { $('.testimonial-content h3').text(to); }); }); wp.customize('tslider_one', function(value) { value.bind(function(to) { $('.testimonial-one img').attr('src', to); }); }); wp.customize('tslider_one_description', function(value) { value.bind(function(to) { $('.testimonial-one p').text(to); }); }); wp.customize('client_name_one', function(value) { value.bind(function(to) { $('.testimonial-one .client-name a').text(to); }); }); wp.customize('client_name_url_one', function(value) { value.bind(function(to) { $('.testimonial-one .client-name a').attr('href', to); }); }); wp.customize('tslider_two', function(value) { value.bind(function(to) { $('.testimonial-two img').attr('src', to); }); }); wp.customize('tslider_two_description', function(value) { value.bind(function(to) { $('.testimonial-two p').text(to); }); }); wp.customize('client_name_two', function(value) { value.bind(function(to) { $('.testimonial-two .client-name a').text(to); }); }); wp.customize('client_name_url_two', function(value) { value.bind(function(to) { $('.testimonial-two .client-name a').attr('href', to); }); }); wp.customize('cta_title', function(value) { value.bind(function(to) { $('.cta-title').text(to); }); }); wp.customize('bizpress_cta', function(value) { value.bind(function(to) { $('.cta-wrapper').text(to); }); }); wp.customize('cta_link_url', function(value) { value.bind(function(to) { $('.cta-button').attr('href', to); }); }); wp.customize('cta_link_text', function(value) { value.bind(function(to) { $('.cta-button').text(to); }); }); wp.customize('bizpress_cta_color', function(value) { value.bind(function(to) { $('.cta-area').css('background-color', to); }); }); wp.customize('bizpress_post_title', function(value) { value.bind(function(to) { $('.home-post-title h3').text(to); }); }); wp.customize('bizpress_post_description', function(value) { value.bind(function(to) { $('.home-post-title p').text(to); }); }); wp.customize('home_contact', function(value) { value.bind(function(to) { $('.contact-details p').text(to); }); }); wp.customize('bizpress_footer_footer_text', function(value) { value.bind(function(to) { $('.site-info').text(to); }); }); // Header text color. wp.customize('header_textcolor', function(value) { value.bind(function(to) { if ('blank' === to) { $('.site-title, .site-description').css({ 'clip': 'rect(1px, 1px, 1px, 1px)', 'position': 'absolute' }); } else { $('.site-title, .site-description').css({ 'clip': 'auto', 'color': to, 'position': 'relative' }); } }); }); });