0
votes

For some reason my icons are not loading for font awesome 5.8.1

All files are indeed being enqueued and are loaded on the page:

wp_enqueue_style( 'fontawesome-solid', 'https://use.fontawesome.com/releases/v5.8.1/css/solid.css', false, NULL, 'all' );
wp_enqueue_style( 'fontawesome-regular', 'https://use.fontawesome.com/releases/v5.8.1/css/regular.css', false, NULL, 'all' );
wp_enqueue_style( 'fontawesome-brands', 'https://use.fontawesome.com/releases/v5.8.1/css/brands.css', false, NULL, 'all' );
wp_enqueue_style( 'fontawesome', 'https://use.fontawesome.com/releases/v5.8.1/css/fontawesome.css', false, NULL, 'all' );

Code:

<span class="header-mob-phone"><i class="fas fa-phone"></i></span>
<span class="header-nav-icon"><i class="fas fa-bars"></i></span>

The outcome is just square boxes, no console errors and font-family is not being overwritten nor is font-weight or any other values from font awesome style sheet.

1
maybe they are PRO version ?Temani Afif
@TemaniAfif neither icon is pro version, I wish it was that simpleDaniel Vickers
and are you sure the font awesome CSS is loading?Temani Afif
@TemaniAfif of course (i.imgur.com/WwKrTOl.png)Daniel Vickers
a link to the website?Temani Afif

1 Answers

1
votes

Ensure the font-weight is right. I had the same issue when using content codes in span tags, but adding font-weight: 900 solved it.