Resolved

Change from loading fonts from fonts.googleapis.com to lokal

Ultra Theme started by S-Kopp Oct 26, 2022 8 replies
S-Kopp Oct 26, 2022 · 9:40 am #17077

Hello,
I can’t find where to remove font loading from fonts.googleapi.com.
Even though I’ve embedded the fonts locally, the fonts are still loaded via fonts.googleapi.com.
The problem is that in Germany this must not happen before the user gives their consent. There are currently masses of warnings due to the violation of the Data Protection Act

Wegkreuz Oct 29, 2022 · 7:08 pm #17091

Hi,

I tried the Plugins OMGF (as proposed) and Local Google Fonts.
For some cases it works, i.e. fonts are loaded from the local server.
However, if I open the developer console in Google Chrome, there is a connection to fonts.gstatic.com.
I my case, dyncamic css seems to be produces by the theme. As Initiator there is an entry with “css?family=Cuprum:400|Cuprum:700&display=block” and the URL “https://fonts.googleapis.com/css?family=Cuprum:400|Cuprum:700&display=block”

Perhaps, the File: \wp-content\themes\ultra\inc\customizer\customizer.php, Line 86 and other is the problem:
/**
* Echo all the CSS
*/
function css() {
// Start by importing Google web fonts
$return = ‘<style type=”text/css” id=”customizer-css”>’;
….
$return .= ‘@import url(//fonts.googleapis.com/css?family=’ . implode( ‘|’, $import ) . ‘&display=block); ‘;

How can we fix the problem urgently?

Is it possible to modify the file so that it refers to a local URL?

knupp Nov 15, 2022 · 3:17 pm #17110

Hello Andrew,
I am having the exact same issue. I have tried to get the fonts with a plugin called “Local google fonts”, and I have tried OMGF as well as you recommended, I have also browsed every site in order to load everything but both plugins aren’t able to find all font loadings from google on this website, while a random google-fonts-checker immediately does.
How can I pinpoint which elements are using the google-loaded fonts, and change the source?

The site I need help with is on http://www.wilde-saiten.de.
Thank you for your help!
Sonja

Andrew Misplon Puro Nov 16, 2022 · 2:26 pm #17120

Hi Sonja

I’ve replied to the thread you opened. Thanks.

Andrew Misplon Puro Nov 16, 2022 · 5:00 pm #17126

Hi Wegkreuz

Apologies for the delay. If you can perhaps open a new support thread, I’d be happy to lend a hand.

Thanks

Andrew

Andrew Misplon Puro Nov 19, 2022 · 10:45 pm #17138

The following can be tried in Code Snippets set to load on the site front-end:

function ultra_child_setup() {
	if ( function_exists( 'siteorigin_webfonts_remove_font' ) ) {
		siteorigin_webfonts_remove_font( 'Muli' );
		siteorigin_webfonts_remove_font( 'Lato' );
	}
	add_filter( 'ultra_import_google_fonts', '__return_false' );
}
add_action( 'after_setup_theme', 'ultra_child_setup', 30 );

Thanks.

Andrew Misplon Puro Nov 20, 2022 · 10:55 am #17140

I’ve updated the above function to avoid an error when switching themes. Thanks.

9 posts
Closed This topic is closed to new replies. Still stuck? Start a new topic in Ultra Theme.