# SOLVED: FontAwesome not intializing if there are none on the page

**URL:** <https://forum.bricksbuilder.io/t/solved-fontawesome-not-intializing-if-there-are-none-on-the-page/2329>\
**Category:** Bugs\
**Created:** [March 7, 2022, 3:35pm UTC](https://forum.bricksbuilder.io/t/solved-fontawesome-not-intializing-if-there-are-none-on-the-page/2329 "2022-03-07T15:35:57Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrogaar](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/m/e36b37/32.png) [@mrogaar](https://forum.bricksbuilder.io/u/mrogaar)\
**Post date:** [March 7, 2022, 3:35pm UTC](https://forum.bricksbuilder.io/t/solved-fontawesome-not-intializing-if-there-are-none-on-the-page/2329/1 "2022-03-07T15:35:57Z")

</div>

**Bricks Version** : 1.3.7  
**Browser** : Chrome  
**OS** : macOS  
**URL** : Local

I’ve made a couple of custom elements that render some Font Awesome icons using

> \< i class=“fas fa-\< icon\>”\>\</ i\>

However, when I have no icons on the page using the Icon element, the FA Icons won’t load and return a 404 error in the console.

A work-around I’ve found is by using display: none on a icon in the header, but this isn’t ideal.

Thanks.

---

<div class="post-metadata">

**Author:** ![timmse](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/timmse/32/1192_2.png) [@timmse](https://forum.bricksbuilder.io/u/timmse)\
**Post date:** [March 8, 2022, 11:16am UTC](https://forum.bricksbuilder.io/t/solved-fontawesome-not-intializing-if-there-are-none-on-the-page/2329/2 "2022-03-08T11:16:34Z")

</div>

Hi Menno,

the icon styles are only loaded if you place an icon or use an icon in a bricks element. This keeps the styles as low as possible. If you want to use an icon in custom code, you need to include the styles manually.

On every page: bricks » settings » custom code » header scripts  
Single Page / Post: settings (the little gear icon on the top left) » page settings » custom code » header scripts

`<link rel="stylesheet" id="bricks-font-awesome-css" href="https://yourdomain.com/wp-content/themes/bricks/assets/css/libs/font-awesome.min.css" media="all">`

Best regards,  
timmse

---

<div class="post-metadata">

**Author:** ![mrogaar](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/m/e36b37/32.png) [@mrogaar](https://forum.bricksbuilder.io/u/mrogaar)\
**Post date:** [March 9, 2022, 3:47pm UTC](https://forum.bricksbuilder.io/t/solved-fontawesome-not-intializing-if-there-are-none-on-the-page/2329/3 "2022-03-09T15:47:47Z")

</div>

That’s pretty smart. Thanks for the explanation.

---

<div class="post-metadata">

**Author:** ![vikmartin](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/v/50afbb/32.png) [@vikmartin](https://forum.bricksbuilder.io/u/vikmartin)\
**Post date:** [April 26, 2023, 4:47pm UTC](https://forum.bricksbuilder.io/t/solved-fontawesome-not-intializing-if-there-are-none-on-the-page/2329/4 "2023-04-26T16:47:04Z")

</div>

Hi - this really helped me - are the header scripts for the other icon libraries published anywhere?

---

<div class="post-metadata">

**Author:** ![timmse](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/timmse/32/1192_2.png) [@timmse](https://forum.bricksbuilder.io/u/timmse)\
**Post date:** [April 26, 2023, 5:00pm UTC](https://forum.bricksbuilder.io/t/solved-fontawesome-not-intializing-if-there-are-none-on-the-page/2329/5 "2023-04-26T17:00:27Z")

</div>

Hey, no. But you can simply insert one icon and copy the link tag when inspecting the styles 🙂

---

<div class="post-metadata">

**Author:** ![vikmartin](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/v/50afbb/32.png) [@vikmartin](https://forum.bricksbuilder.io/u/vikmartin)\
**Post date:** [April 26, 2023, 5:14pm UTC](https://forum.bricksbuilder.io/t/solved-fontawesome-not-intializing-if-there-are-none-on-the-page/2329/6 "2023-04-26T17:14:08Z")

</div>

Brilliant - Thanks… I should have thought of that!

---

<div class="post-metadata">

**Author:** ![rhkittredge](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/r/5f8ce5/32.png) [@rhkittredge](https://forum.bricksbuilder.io/u/rhkittredge)\
**Post date:** [March 12, 2024, 1:15pm UTC](https://forum.bricksbuilder.io/t/solved-fontawesome-not-intializing-if-there-are-none-on-the-page/2329/7 "2024-03-12T13:15:44Z")

</div>

This is helpful, thanks. However on this page of the Bricks Academy [Asset Loading Optimization – Bricks Academy](https://academy.bricksbuilder.io/article/asset-loading/) it shows how to enqueue the font awesome library if it needs to be loaded manually. This isn’t working though. I looked thru the Bricks code and the call should actually look like this: wp\_enqueue\_style( ‘bricks-font-awesome-6’ ); but it still doesn’t work (I tried with the -6 and without the -6).

I’d just rather use the Bricks function than hard-code using if possible. Any idea why the Bricks recommended enqueue isn’t working?

Thanks

---

<div class="post-metadata">

**Author:** ![thomas](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/thomas/32/3_2.png) [@thomas](https://forum.bricksbuilder.io/u/thomas)\
**Post date:** [March 12, 2024, 4:36pm UTC](https://forum.bricksbuilder.io/t/solved-fontawesome-not-intializing-if-there-are-none-on-the-page/2329/8 "2024-03-12T16:36:10Z")

</div>

@rhkittredge The font icon styles are currently not registered, so the enqueue doesn’t have any effect. We’ll fix this next. In the meantime you can enqueue the icon font styles like this:

```auto
wp_enqueue_style( 'bricks-font-awesome-6', BRICKS_URL_ASSETS . 'css/libs/font-awesome-6.min.css', ['bricks-frontend'], filemtime( BRICKS_PATH_ASSETS . 'css/libs/font-awesome-6.min.css' ) );
wp_enqueue_style( 'bricks-font-awesome-6-brands', BRICKS_URL_ASSETS . 'css/libs/font-awesome-6-brands.min.css', ['bricks-frontend'], filemtime( BRICKS_PATH_ASSETS . 'css/libs/font-awesome-6-brands.min.css' ) );
wp_enqueue_style( 'bricks-ionicons', BRICKS_URL_ASSETS . 'css/libs/ionicons.min.css', ['bricks-frontend'], filemtime( BRICKS_PATH_ASSETS . 'css/libs/ionicons.min.css' ) );
wp_enqueue_style( 'bricks-themify-icons', BRICKS_URL_ASSETS . 'css/libs/themify-icons.min.css', ['bricks-frontend'], filemtime( BRICKS_PATH_ASSETS . 'css/libs/themify-icons.min.css' ) );

```

---

<div class="post-metadata">

**Author:** ![rhkittredge](https://forum.bricksbuilder.io/letter_avatar_proxy/v4/letter/r/5f8ce5/32.png) [@rhkittredge](https://forum.bricksbuilder.io/u/rhkittredge)\
**Post date:** [March 12, 2024, 4:54pm UTC](https://forum.bricksbuilder.io/t/solved-fontawesome-not-intializing-if-there-are-none-on-the-page/2329/9 "2024-03-12T16:54:56Z")

</div>

> [@thomas](#):
>
> `wp_enqueue_style( 'bricks-font-awesome-6', BRICKS_URL_ASSETS . 'css/libs/font-awesome-6.min.css', ['bricks-frontend'], filemtime( BRICKS_PATH_ASSETS . 'css/libs/font-awesome-6.min.css' ) );`

That worked perfectly, thanks Thomas.

---

<div class="post-metadata">

**Author:** ![timmse](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/timmse/32/1192_2.png) [@timmse](https://forum.bricksbuilder.io/u/timmse)\
**Post date:** [March 18, 2024, 12:24pm UTC](https://forum.bricksbuilder.io/t/solved-fontawesome-not-intializing-if-there-are-none-on-the-page/2329/10 "2024-03-18T12:24:30Z")

</div>

Hi guys,

We’ve fixed this issue in Bricks 1.9.7(.1), now available as a one-click update in your WordPress Dashboard.

**Please take your time and read the changelog carefully as Bricks 1.9.7(.1) contains breaking changes that will make your Bricks website more secure.**

Changelog: [Bricks 1.9.7 Changelog – Bricks](https://bricksbuilder.io/release/bricks-1-9-7/)

Please let us know if you are still experiencing issues.
