Title: enqueue mo.js script
Last modified: January 14, 2022

---

# enqueue mo.js script

 *  [tskpbls](https://wordpress.org/support/users/tskpbls/)
 * (@tskpbls)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/enqueue-mo-js-script/)
 * Hi,
 * I am having a hard time to figure out how to enqueue a script to create a burst
   effect when hovering a link.
 * These are my very first steps on theme creation and javascript.
 * I have enqueued the mo.js script from its cdn and I am able to display its effect
   on links ONLY WHEN using a gutenberg custom/html block with the js code inside.
   Of course, this works only on the post where the custom/html resides.
 * I have tried to follow some tutorials here and there :
    -  [https://capitainewp.io/formations/developper-theme-wordpress/charger-les-scripts-et-les-styles/](https://capitainewp.io/formations/developper-theme-wordpress/charger-les-scripts-et-les-styles/)
      
      [https://diveinwp.com/enqueue-include-scripts-javascripts-jquery-in-wordpress/](https://diveinwp.com/enqueue-include-scripts-javascripts-jquery-in-wordpress/)
 * I am using underscores theme as a starting point :
 *     ```
       /**
        * Enqueue scripts and styles.
        */
       function capables_scripts() {
       	wp_enqueue_style( 'capables-style', get_stylesheet_uri(), array(), _S_VERSION );
       	wp_style_add_data( 'capables-style', 'rtl', 'replace' );
   
       	wp_enqueue_script( 'capables-navigation', get_template_directory_uri() . '/js/navigation.js', array(), _S_VERSION, true );
       	wp_enqueue_script('mojs', 'https://cdn.jsdelivr.net/mojs/latest/mo.min.js', array(), _S_VERSION, true );
   
       	if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
       		wp_enqueue_script( 'comment-reply' );
       	}
       }
       add_action( 'wp_enqueue_scripts', 'capables_scripts' );
       ```
   

Viewing 1 replies (of 1 total)

 *  Thread Starter [tskpbls](https://wordpress.org/support/users/tskpbls/)
 * (@tskpbls)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/enqueue-mo-js-script/#post-15254144)
 * I’d be glad if someone could try to explain me why, if I add a js file called
   test under my theme and use :
 *     ```
       function my_custom_js() {
           echo '<script type="text/javascript" src="js/test.js></script>';
       }
       add_action( 'wp_footer', 'my_custom_js' );
       ```
   
 *  under functions.php
 * it does not work, but if I paste directly my test.js code inside wp_footer it’s
   working correctly. What I am doing wrong?
    -  This reply was modified 4 years, 4 months ago by [tskpbls](https://wordpress.org/support/users/tskpbls/).

Viewing 1 replies (of 1 total)

The topic ‘enqueue mo.js script’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [tskpbls](https://wordpress.org/support/users/tskpbls/)
 * Last activity: [4 years, 4 months ago](https://wordpress.org/support/topic/enqueue-mo-js-script/#post-15254144)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
