How to Fix FontAwesome Icons Not Working on Custom WordPress Theme - Brown Surfing

How to Fix FontAwesome Icons Not Working on Custom WordPress Theme

I had made a previous showing how to make FontAwesome icons work on an HTML website (you can watch it here: How to Fix FontAwesome Icons on HTML Site

Use SVG Instead of WebFont Moving Forward

Posted on: April 25th, 2019
By: Efrain Lemus

In your custom WordPress theme website, you’ll need to add this code within the functions.php where all the styles are being loaded.

Instead of calling for the CSS WebFont like this:

wp_enqueue_style(‘font-awesome-solid’, ‘//use.fontawesome.com/releases/v5.8.1/css/all.css’);

Call for the FontAwesome SVG, and this might fix your error, like this:

wp_enqueue_script(‘font-awesome-solid’, ‘//use.fontawesome.com/releases/v5.8.1/js/all.js’);

Note: these are the updated FontAwesome icons’ links as of April 25, 2019.

Music credits: https://www.bensound.com

Have any questions or comments? Write them below!


Leave a Reply

Your email address will not be published.