Guide: How to Load Font Awesome 5 - by thisisbolo

This topic has 2 replies, 2 voices, and was last updated 6 years, 10 months ago ago by Olga Barlow

  • Avatar: thisisbolo
    thisisbolo
    Participant
    January 13, 2018 at 17:54

    For anyone interested in loading Font Awesome 5 into the current theme until it’s released in a theme update you can do the following.

    Add this into your functions.php (use your child theme)

    /******************************************************************************/
    /**************************** Load Font Awesome 5 *****************************/
    /******************************************************************************/
    
    add_action( 'wp_enqueue_scripts', 'enqueue_load_fa' );
    function enqueue_load_fa() {
     
        wp_enqueue_style( 'load-fa', 'https://use.fontawesome.com/releases/v5.0.2/css/all.css' );
    

    Then call it in. There’s some slight differences between FA4 and FA5. So take a moment to read up on them to use it properly.

    https://fontawesome.com/how-to-use/svg-with-js

    This is just a quick hack, might not be the best approach and may affect your site loading times since you’re loading up 2 libraries. Ideally, this should be removed when the themes updated with the new icon pack.

    Temporary solution only! Just sharing. If anyone knows a better solution, please share. This is only what I discovered.

    1 Answer
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    January 15, 2018 at 17:19

    Hello,

    Thank you for your temporary solution!
    We plan to update FontAwesome in one of the next updates.

    Regards

  • Viewing 2 results - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.Log in/Sign up

8theme customization service
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.