How to migrate jQuery libraries to Zepto.js in wordpress website?

203 Views Asked by At

I have a WordPress website with JQuery libraries and I want to migrate it to Zepto.js. How can I achieve this? Any Suggestions or guides?

1

There are 1 best solutions below

2
theboss_dev On

You can use wp_enqueue_script() function to add js file with jQuery dependency.

Try out this code:

function zillion_add_zepto_script()
{


    wp_enqueue_script('zepto-js', 'https://zeptojs.com/zepto.min.js', array('jquery'), 1.1, true);

}
add_action('wp_enqueue_scripts', 'zillion_add_zepto_script');