# Error with "Preload Local Fonts" in Kadence theme

**URL:** <https://community.localwp.com/t/error-with-preload-local-fonts-in-kadence-theme/25195>\
**Category:** Support\
**Tags:** xdebug, linux, linux-manjaro\
**Created:** [April 12, 2021, 8:16am UTC](https://community.localwp.com/t/error-with-preload-local-fonts-in-kadence-theme/25195 "2021-04-12T08:16:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![bienveillant](https://avatars.discourse-cdn.com/v4/letter/b/5fc32e/32.png) [@bienveillant](https://community.localwp.com/u/bienveillant)\
**Post date:** [April 12, 2021, 8:16am UTC](https://community.localwp.com/t/error-with-preload-local-fonts-in-kadence-theme/25195/1 "2021-04-12T08:16:28Z")

</div>

When I enable “Load Google font locally” and “Preload Local Fonts” in Kadence theme (General/Performance), I got this error :

Fatal error: Uncaught Error: Maximum function nesting level of ‘256’ reached, aborting! in […]/app/public/wp-includes/class-wp-object-cache.php on line 493

Local v5.10.3+5332 on Linux (Manjaro)

---

<div class="post-metadata">

**Author:** ![ben.turner](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/ben.turner/32/5366_2.png) [@ben.turner](https://community.localwp.com/u/ben.turner)\
**Post date:** [April 12, 2021, 3:46pm UTC](https://community.localwp.com/t/error-with-preload-local-fonts-in-kadence-theme/25195/2 "2021-04-12T15:46:29Z")

</div>

> [@bienveillant](#):
>
> Maximum function nesting level of ‘256’ reached,

That’s an error that I’ve seen related to Xdebug. You should be able to uncrease the number so that you can use those features of the Kadence theme:

> <https://stackoverflow.com/questions/8656089/solution-for-fatal-error-maximum-function-nesting-level-of-100-reached-abor/10512188#10512188>

Basically, you should be able to open the `site-name/conf/php/php.ini.hbs` file for the site and add a line like this to the `xdebug` section:

```auto
xdebug.max_nesting_levels=500

```

 ![image](https://us1.discourse-cdn.com/flex019/uploads/lwpforums/original/2X/d/df9d30bc9f8574127df596a8bca562873ad0d15f.jpeg)

In the above screenshot I have 500, but you could go higher. Just add that value, and restart the site in Local so that those settings are re-compiled and used.

The only thing to consider is that this setting is in place because when running Xdebug, the PHP application uses much more memory, which means that a function (and by extension a stacktrace) that is nested more than 256 times will take up a lot of memory.

Higher values aren’t “bad,” but if you aren’t careful, your computer could crash or have performance issues because this site is using too much ram.

---

<div class="post-metadata">

**Author:** ![bienveillant](https://avatars.discourse-cdn.com/v4/letter/b/5fc32e/32.png) [@bienveillant](https://community.localwp.com/u/bienveillant)\
**Post date:** [April 22, 2021, 9:22am UTC](https://community.localwp.com/t/error-with-preload-local-fonts-in-kadence-theme/25195/3 "2021-04-22T09:22:48Z")

</div>

Thank you for your answer!

Why not turn off Xdebug instead ? I don’t even know what it is so I probably don’t need it…

Or maybe loading the google font with a code snippet like here

> **[Add Google Web Fonts in WordPress The Right Way - WordPress Code Snippets](http://wpcodesnippet.com/add-google-web-fonts-wordpress-right-way/)**
>
> Google provides instructions to add Google Web Fonts in head of static HTML website. And here is how to add Google web fonts in WordPress the right way.

Thank’s again!

---

<div class="post-metadata">

**Author:** ![ben.turner](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/ben.turner/32/5366_2.png) [@ben.turner](https://community.localwp.com/u/ben.turner)\
**Post date:** [April 22, 2021, 4:02pm UTC](https://community.localwp.com/t/error-with-preload-local-fonts-in-kadence-theme/25195/4 "2021-04-22T16:02:39Z")

</div>

> [@bienveillant](#):
>
> Why not turn off Xdebug instead ?

That’s probably another option. Xdebug is a development tool which gives a lot more information about PHP errors. Usually Xdebug isn’t activated, or has limited options in a production environment, but in a dev environment like Local, it can be really helpful in zeroing in quickly on where a problem is occuring.

This help doc goes into more detail about some of the specific things that Xdebug is doing when enabled:

- [Xdebug within Local - Local](https://localwp.com/help-docs/advanced/using-xdebug-within-local/)

If you don’t need those kinds of features, then you can definitely disable Xdebug.

---

<div class="post-metadata">

**Author:** ![bienveillant](https://avatars.discourse-cdn.com/v4/letter/b/5fc32e/32.png) [@bienveillant](https://community.localwp.com/u/bienveillant)\
**Post date:** [April 23, 2021, 9:14am UTC](https://community.localwp.com/t/error-with-preload-local-fonts-in-kadence-theme/25195/5 "2021-04-23T09:14:18Z")

</div>

Thank you for the answer!  
Other than adding a few code snippets, I don’t really develop in PHP. And I could always turn it on if needed.

---

<div class="post-metadata">

**Author:** ![bienveillant](https://avatars.discourse-cdn.com/v4/letter/b/5fc32e/32.png) [@bienveillant](https://community.localwp.com/u/bienveillant)\
**Post date:** [April 24, 2021, 11:06am UTC](https://community.localwp.com/t/error-with-preload-local-fonts-in-kadence-theme/25195/6 "2021-04-24T11:06:53Z")

</div>

I tried with xdebug.max\_nesting\_levels=1000 or xdebug.remote\_enable=0 but nothing changes.  
I also noticed that my site doesn’t sthow he same fonts on firefox and chrome ?

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/system/32/1_2.png) [@system](https://community.localwp.com/u/system)\
**Post date:** [July 23, 2021, 11:06am UTC](https://community.localwp.com/t/error-with-preload-local-fonts-in-kadence-theme/25195/7 "2021-07-23T11:06:55Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
