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 trying to configure W3 total cache plugin to speed up my site. The minify option is great but I am running into the following issue:
Let's say I have a JavaScript file I am attached wp_localize script() to and it's called 'additions.js'. Because W3TC minifies this JavaScript file and renames it, the wp_localize_script() function no longer sees my 'additions.js' file and the variables inside it don't get shared with it.
Does anyone have a solution for this? Let me know if anything is unclear.

share|improve this question

1 Answer 1

up vote 5 down vote accepted

W3 Total Cache has 4 locations to include the minified files. Since wp_localize_script() hooks into wp_head() (unless you specify in footer in your enqueue) you can use the before </body> minify location and your script will have access to the variables set. On some occasions this has failed for me so I just exclude the script from minify.

share|improve this answer
    
This seems to work. Thank you! –  Roman Epicnerd Sharf Jul 12 '12 at 3:05

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.