- This topic has 12 replies, 2 voices, and was last updated 3 years, 2 months ago by
John David.
-
AuthorPosts
-
February 13, 2023 at 2:28 am #2531147
John David
Hi there,
I am using Generatepress premium and Generateblocks.
I have installed a locally hosted font and customised my site to use it.
However, my site still contacts googleapis – whether it actually downloads fonts there or not I don’t know. But I want to remove that contact.
I see the following on my home page:
<link rel=’dns-prefetch’ href=’//fonts.googleapis.com’ />
and
<link rel=’stylesheet’ id=’generateblocks-google-fonts-css’ href=’https://fonts.googleapis.com/css’ media=’all’ />
I assume one is created by Gpress and the other by Gblocks.I have read and tried everything I can find, and nothing seems to help.
For example, I have placed this in a code snipet:
add_action( ‘wp_enqueue_scripts’, function() {
wp_dequeue_style( ‘generate-fonts’ );
} );
add_action( ‘admin_init’, function() {
add_filter( ‘generate_google_fonts_array’, ‘__return_empty_array’ );
} );
To no effect.I read in Generateblocks that there is a simple switch (https://docs.generateblocks.com/article/typography-overview/), but it does not show on my site.
None of the advice I can find seems to apply.Please can you tell me what to do?
February 13, 2023 at 3:30 am #2531232David
StaffCustomer SupportHi there,
can you share a link to your site where i can look to see which GenerateBlocks element has a google font applied to it.
February 13, 2023 at 4:17 am #2531276John David
Hi David,
February 13, 2023 at 4:19 am #2531280John David
Sorry, typo!
https://haligax-translation.comFebruary 13, 2023 at 4:19 am #2531282John David
Another typo – what’s happening?
February 13, 2023 at 4:34 am #2531295David
StaffCustomer Support🙂
Is there a specific page or post where the request is being made ?February 14, 2023 at 5:50 am #2532817John David
I checked these instances of contacting googleapis on my home page, but it’s the same on all pages.
I checked the waterfall, funny, it has this close to the top:
css (canceled) fonts.googleapis.com 0 78ms
open-sans-v18-latin-regular.woff2 (canceled) halifax-translation.com 0 333ms
open-sans-v18-latin-600.woff2 (canceled) halifax-translation.com 0 362ms
open-sans-v18-latin-italic.woff2 (canceled) halifax-translation.com 0 401ms
open-sans-v18-latin-600italic.woff2 (canceled) halifax-translation.com 0 441msThen, almost as the last item, it proceeds to load the fonts from our site.
Can there be an issue with using ‘font-display: swap;’ in the @font-face declarations?
February 14, 2023 at 7:29 am #2532929David
StaffCustomer SupportAh ok, it didn’t show before, maybe a cache thing.
Looking at the GB CSS.
I see 4 instances of where a font has been selected in the block editor.
And they are all buttons, the Get a Quote, Mail Us, Call Us and other Get a Quote.Can you check to see if any of those have the Google font selected ?
February 14, 2023 at 8:17 am #2533133John David
D’oh! (as Homer Simpson says).
That’s where the Gblocks Googleapis option is!
This seems to be the solution. Many thanks!
February 14, 2023 at 8:49 am #2533149John David
An interesting point for anyone with the same problem:
Where I have a stack of a few cells, when I work down switching off the “Use Googleapis font” toggle, the third one in each stack re-sets itself to “on” as I go further down. I have to check them again. When I switch it off for a second time, it stays off.Thanks again for your patience!
February 14, 2023 at 8:52 am #2533154John David
Oh, and one more thing:
Where I have a single button, there is no Googleapis font toggle to be seen (this is why I dd not understand the advice I previously found on this forum). It’s only where I have a stack that the toggle is visible in each cell.February 14, 2023 at 9:07 am #2533171David
StaffCustomer SupportGlad to hear you got it resolved.
We will be improving the way GB handles google fonts in the future, including a filter to disable the API completely.🙂
February 15, 2023 at 2:15 am #2533833John David
Great.
Thanks once more for excellent support. -
AuthorPosts
- You must be logged in to reply to this topic.