Site logo

Archived topic

Disable google fonts

11 replies · Started by Olaf on September 24, 2019

Viewing posts 1–12 of 12

Hi.

I've changed the fonts via Customizer to browser fonts. body = Tahoma, everything else inherit.

But still the google fonts are loaded ... even if I add the following code to the functions.php:

add_action( 'wp_enqueue_scripts','tu_remove_google_fonts', 10 );
function tu_remove_google_fonts() {
wp_dequeue_style( 'generate-fonts' );
}

What can I do to stop it? Many thanks in advance.

Hi there,

just checked your site and i cannot see any google font requests. Maybe its cached in your browser?

Hi David

thanks for the quick answer.

When I check the website with https://tools.pingdom.com it says that Google sends a request (fonts.googleapis.com). The same result in Developer Tools (Chrome).

I've deleted my browser cache, checked all plugins and integrated the following code:

add_action( 'admin_init', 'tu_remove_google_fonts' );
function tu_remove_google_fonts() {
add_filter( 'generate_google_fonts_array', '__return_false' );
}

Maybe you have another idea where the request is hiding!? ;-)

GT Metrix for me has no Google fonts. Pingdom does which may mean its getting a CDN Cacheed file.
Does your server use CloudFlare ? If so give that a clean.

Hi David

GT Metrix finds the request, too. ;-)

Could you please have a look at the tab "Waterfall"?

You'll find "fonts.googleapis.com" at the lower part. The font is "Montserrat".

I don't use CloudFlare.

-----

And I have a new problem: When you load the website for the first time, you can only see the bottom half of the logo. After you reload the page, the logo is in its desired position (mobile & Desktop, Chrome) ... but that seemingly doesn't work in FF. Strange, isn't it?

I use Autoptimize and have cleared the cache.

Looks like the Pop Up maker is calling the google font.
You have some CSS that is moving the logo position up ?

Hi.

And thanks again for the fast answer.

Problem 1 solved!!! It was the Pop Up Maker ... Thanks for the indication.

--

"You have some CSS that is moving the logo position up ?"

If we have than it was not on purpose. :-(

Check in the Customizer > Additional CSS - remove this:

.site-branding,
.site-logo {
	position: absolute;
	left: 50%;
	-webkit-transform: translateX(-50%);
	transform: translateX(-50%);
	z-index: 200;
}

Hi David

that works. Thanks again.

But now another - maybe my last - question: ;-)

How can I now center the logo again?

Hi there,

Try this CSS:

.site-logo {
    margin-left: auto;
    margin-right: auto;
}

Let me know :)

Yeah. Works. Thanks a lot! :-)

You're welcome :)

This archived topic is closed to new replies.