How to use = wp_enqueue_style with CDN in wordpress?

My current code is:

wp_enqueue_style( 'script-css', plugins_url( 'script/myscript.js', __FILE__ ));

My goal: Instead of loading the file from the plugins directory, I want to download the script file from http://mycloudfronturl.net/myscript.js

But for some reason I was messing around with quotes or when replacing plugins_url. I am not hard php coder code, so can someone tell me what to do, please?

+4
source share
1 answer

Use enqueue_script instead. Example example:

wp_register_script('some_script', 'http://anywhereyouwant.com');
wp_enqueue_script('some_script');
+4
source

All Articles