Fontawesome Script Cloudflare CDN

Hi,

I’m no technical guy so I need some help.

This is my current fontawesome script in my functions.php.
I just want to know what and where to change in the script below using Cloudflares fontawesome cdn.

add_action( 'wp_enqueue_scripts', 'tthq_add_custom_fa_css' );

function tthq_add_custom_fa_css() {
wp_enqueue_style( 'custom-fa', 'https://use.fontawesome.com/releases/v5.11.2/css/all.css' );
}

Should I just change the link in the wp_enqueue_style to the link below?

https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.1/js/all.min.js

Thank you!

That’s a CSS (Style) call. Try this one instead:
https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.1/css/all.min.css

Thank you!

1 Like