WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am adding a javascript file through the functions.php file. I am using the method as suggested on Wordpress Codex. One question I have is that what is the best way to handle the version number column. Is it recommended to send the version of jquery or the version of the script I am loading? Using this code.

function my_scripts_method() {
// register your script location, dependencies and version
   get_template_directory_uri() . '/js/custom_script.js',
   '1.0' );
 // enqueue the script
add_action('wp_enqueue_scripts', 'my_scripts_method');
share|improve this question
up vote 0 down vote accepted

The version is the version of your own script, and is appended to the filename in the src attribute of the script tag. This is so you can employ long-term caching on the client-side and still insure a new version of your script will be fetched from the server rather than local cache if you update it.

share|improve this answer
Just what I neded – viyyer Jan 4 '12 at 18:29

Your Answer


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.