Load JavaScript Libraries in WordPress


/ Published in: PHP
Save to your folder(s)

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


Copy this code and paste it in your HTML
  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. }

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

Report this snippet


Comments


You need to login to view comments.