Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am just getting into using the theme customizer in WordPress. I found a great answer on this site about adding a slider and I got it working just fine. I was reading in the codex about the theme-customizer and it says that after you add your settings, you need to add to the theme-customizer.js file to update your settings. Does this really need to be done? I noticed that without adding my settings to this file that the slider images that I just got working seem to work just fine. So I am a little confused on this step. I can't even find the information that the codex is talking about in the default theme.

If you check "Step Two" in this link You will see that it is talking about adding a bunch of javascript to the theme. I don't see that it is needed. Things seem to update just fine without adding any javascript.

Even with these settings. The codex says that this stage is optional. I have added 3 photo uploads for a slider. Just to test out the customizer. The theme updates in real time without adding this kind of information about my new controls

$wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
$wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
$wp_customize->get_setting( 'background_color' )->transport = 'postMessage';
share|improve this question
    
Could you link to instructions you are talking about? There seems to be no such script in WordPress core. –  Rarst Nov 17 '13 at 16:43
    
I have edited my question to include the link and a little more information –  Jamie Nov 17 '13 at 20:04

1 Answer 1

up vote 0 down vote accepted

It's not a necessary step but it is ideal. Adding the javascript is necessary to enable live-reloading within the Theme Customizer.

What this does is, when you alter a control, albeit a textbox, colorwheel, image upload, whatever. After the adjustment is made, if you have enabled live-reload, then a moment later the preview will refresh and display the change.

If you do not have the javascript built out and live reload setup then the adjustments will not be displayed until the user saves their changes and refreshes the page.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.