2

This is my original code that pulled Font Awesome icons, which is placed in my functions.php file:

wp_enqueue_style( 'prefix-font-awesome', '//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.1/css/font-awesome.min.css', array(), '4.6.1' );

They've recently started offering unique embed codes that appear like so:

<script src="https://use.fontawesome.com/##########.js"></script>

But I'm not sure how to use this with wp_enqueue_style.

  • 2
    You'll have to use wp_enqueue_script, but it is similar. – cjbj May 23 '16 at 13:58
1

The full snippet would be this:

wp_enqueue_script( 'prefix-font-awesome', 'https://use.fontawesome.com/##########.js' );
  • Why did you use 'wp_enqueue_script' instead of 'wp_enqueue_style' for CSS? – I am the Most Stupid Person Sep 22 '17 at 9:37
  • 1
    @IamtheMostStupidPerson Because it's not css but javascript. – cjbj Sep 23 '17 at 10:58
  • Is it have any difference on using https:// rather than //address ? – Vishwa Jul 31 '18 at 9:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.