Hello community!
I’m trying to load Lottie’s library CDN and my custom script, but as I see in my browser’s network tab, no js is loading.
No errors in debug.logneitherr. This is my code:
`function enqueue_custom_scripts() {`
`// Enqueue Lottie library`
`wp_enqueue_script(‘lottie-library’, ‘https://cdn.jsdelivr.net/npm/lottie-web@latest’, array(), null, true);`
`// Enqueue your custom script`
`wp_enqueue_script(‘flower-animation’, get_template_directory_uri() . ‘/js/flower-animation.js’, array(‘lottie-library’), null, true);`
`// Localize the script with new data`
`wp_localize_script(‘flower-animation’, ‘theme_vars’, array(`
`’template_directory_uri’ => get_template_directory_uri(),`
`));`
`}`
`add_action(‘wp_enqueue_scripts’, ‘enqueue_custom_scripts’);`
The rest of my functions.php’s enqueuing is working just fine.
Help!!!
[ad_2]