Posted By

selfmadepsyche on 02/17/09


Tagged

wordpress


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

tmbrenneke
jonkemp


Loading Javascript Libraries in Wordpress generated page


 / Published in: PHP
 

Load jQuery into WordPress generated pages, the wpenqueuescript function can be used in plugins as well. OR Add and load a new script that depends on jQuery (this will also cause it to load jQuery into the page as well).

  1. <?php wp_enqueue_script('jquery'); ?>
  2.  
  3. <?php wp_enqueue_script('jquery'); ?>
  4.  
  5.  
  6.  
  7. <?php wp_enqueue_script('newscript','/wp-content/plugins/someplugin/js/newscript.js',array('jquery'),'1.0' ); ?>

Report this snippet  

You need to login to post a comment.