Posted By

Quaspie on 11/28/14


Tagged

javascript wordpress jquery


Versions (?)

Enqueue Javascript that requires jQuery in WordPress


 / Published in: PHP
 

Put this code in your functions.php file to enqueue /js/general.js jQuery document easily.

  1. /* Enqueue scripts */
  2. function wpdev_enqueue_scripts() {
  3. wp_enqueue_script('general-script', get_stylesheet_directory_uri() . '/js/general.js', array('jquery'), false, true);
  4. }
  5. add_action('wp_enqueue_scripts', 'wpdev_enqueue_scripts');

Report this snippet  

You need to login to post a comment.