Posted By

jonkemp on 08/05/10


Tagged

php wordpress


Versions (?)

Who likes this?

5 people have marked this snippet as a favorite

fillyouin
maxvee8
mikoli
laurentzziu
kwameboame


Load JavaScript Libraries in WordPress


 / Published in: PHP
 

URL: http://codex.wordpress.org/Function_Reference/wp_enqueue_script

This code adds the specified library to the header in WordPress unless you are in the admin section.

  1. if ( !is_admin() ) { // instruction to only load if it is not the admin area
  2. // LOAD JQUERY
  3. wp_enqueue_script('jquery');
  4.  
  5. // LOAD EXTERNAL LIBRARY
  6. wp_enqueue_script('jquery-ext', 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js');
  7. }

Report this snippet  

You need to login to post a comment.