( function( $ ) { // Update the site title in real time... wp.customize( 'blogname', function( value ) { console.log('blogname',value); value.bind( function( newval ) { console.log('blogname',newval); akbar_create_settings(); $(document).attr("title", newval); // $( '#site-title a' ).html( newval ); } ); } ); //Update the site description in real time... wp.customize( 'blogdescription', function( value ) { console.log('blogdescription',value); value.bind( function( newval ) { console.log('blogdescription',newval); akbar_create_settings(); // $( '.site-description' ).html( newval ); } ); } ); //Update the site description in real time... wp.customize( 'display_header_text', function( value ) { console.log('display_header_text',value); value.bind( function( newval ) { console.log('display_header_text',newval); akbar_create_settings(); // $( '.site-description' ).html( newval ); } ); } ); //Update the site description in real time... wp.customize( 'custom_logo', function( value ) { // console.log('custom_logo',value); value.bind( function( newval ) { // console.log('newval',newval); akbar_create_settings(); // $( '.akbar-logo-parent1' ).html( newval ); } ); } ); //Update site title color in real time... wp.customize( 'header_textcolor', function( value ) { console.log('header_textcolor',value); value.bind( function( newval ) { console.log('header_textcolor',newval); akbar_create_settings(); // $('#site-title a').css('color', newval ); } ); } ); //Update site background color... wp.customize( 'background_color', function( value ) { // console.log('background-color',value); value.bind( function( newval ) { console.log('background-color',newval); $('body').css('background-color', newval ); akbar_create_settings(); } ); } ); wp.customize( 'header_image', function( value ) { // console.log('custom_logo',value); value.bind( function( newval ) { // console.log('newval',newval); akbar_create_settings(); // $( '.akbar-logo-parent1' ).html( newval ); } ); } ); function akbar_create_settings() { // var data = { // 'action': 'akbar_ajax_action', // 'akbar_we_value': akbar_admin_ajax_object.akbar_we_value // We pass php values differently! // }; // // We can also pass the url value separately from ajaxurl for front end AJAX implementations // jQuery.post(akbar_admin_ajax_object.ajax_url, data, function (response) { // alert('Got this from the server: ' + response); window.location.href = window.location.href; // }); } } )( jQuery );