Title: Problem with js enqueue in WordPress multisite
Last modified: June 14, 2021

---

# Problem with js enqueue in WordPress multisite

 *  [nenosw](https://wordpress.org/support/users/nenosw/)
 * (@nenosw)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/problem-with-js-enqueue-in-wordpress-multisite/)
 * Hi
 * Im trying to enqueue a couple of js files in a wordpress multisite environment.
   I copied the code from a single site where it worked perfectly, but now it seems
   that WordPress isnt loading these scripts at all. What could be the problem, 
   any ideas?
 * The js files are in a child theme and the child theme is activated on the site
   im working on.
 * thanks
 *     ```
       function wpb_adding_scripts() {
       	wp_register_script('lightslider-script', get_stylesheet_directory_uri() . '/js/lightslider.js', array('jquery'),'1.1', true);
       	wp_enqueue_script('lightslider-script');
       	wp_register_script('lightgallery-script', get_stylesheet_directory_uri() . '/js/lightgallery-all.js', array('jquery'),'1.1', true);
       	wp_enqueue_script('lightgallery-script');
       	wp_register_script('ls-script', get_stylesheet_directory_uri() . '/js/ls.js', array('jquery'),'1.1', true);
       	wp_enqueue_script('ls-script');
       }
   
       add_action( 'wp_enqueue_scripts', 'wpb_adding_scripts' );
       ```
   
    -  This topic was modified 4 years, 11 months ago by [nenosw](https://wordpress.org/support/users/nenosw/).

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Topher](https://wordpress.org/support/users/topher1kenobe/)
 * (@topher1kenobe)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/problem-with-js-enqueue-in-wordpress-multisite/#post-14555930)
 * If you really want to run them on EVERY site on the network, make a plugin and
   put it in mu-plugins. Docs here: [https://wordpress.org/support/article/must-use-plugins/](https://wordpress.org/support/article/must-use-plugins/)
 *  Thread Starter [nenosw](https://wordpress.org/support/users/nenosw/)
 * (@nenosw)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/problem-with-js-enqueue-in-wordpress-multisite/#post-14557365)
 * Thanks for your answer. I will try that.
    Just out of curiosity, what if I want
   to use them just on a single site, how would i proceed then? Because at the moment
   its not being loaded anywehere.
 *  [pappas2626](https://wordpress.org/support/users/pappas2626/)
 * (@pappas2626)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/problem-with-js-enqueue-in-wordpress-multisite/#post-14642110)
 * Thank you for updating us with the outcome.
 * [Omegle](https://www.omegle.kim/)

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Problem with js enqueue in WordPress multisite’ is closed to new replies.

 * In: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
 * 3 replies
 * 3 participants
 * Last reply from: [pappas2626](https://wordpress.org/support/users/pappas2626/)
 * Last activity: [4 years, 10 months ago](https://wordpress.org/support/topic/problem-with-js-enqueue-in-wordpress-multisite/#post-14642110)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
