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://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)
Viewing 1 replies (of 1 total)
- The topic ‘enqueue mo.js script’ is closed to new replies.