- This topic has 24 replies, 2 voices, and was last updated 5 years, 11 months ago by Tom.
-
AuthorPosts
-
April 10, 2018 at 3:47 am #546145Anton
Hi guys,
I have an issue with one of my websites running on GP Premium + Elementor pro. When watching the site in the backend of Elementor, I can see all the fonts as they should appear. But on the frontend, it’s all a different font.
I made a ticket to Elementor, and they say this:
It is somehow related to their theme that has an outdated google fonts code that may be causing this concern or your hosting provider is blocking google fonts. I would advise you to report this on your hosting provider or your theme provider so you wouldn’t have an issue in the future.
When reaching out to my hosting provider, they said to add this code to my functions.php:
function mytheme_enqueue_styles() {
wp_register_style(‘googleFonts’,’//fonts.googleapis.com/css?family=Copse’);
wp_enqueue_style( ‘googleFonts’);
}Yet, the issue still isn’t solved. Currently the fonts are barely readable.
April 10, 2018 at 9:04 am #546457TomLead DeveloperLead DeveloperGP uses that method for all Google fonts by default.
Your site is currently set to “Poppins”, and the font is displaying nicely for me.
Are you trying to set a different font?
I’m not really sure what Elementor support is talking about – there isn’t an outdated way of including Google fonts. They’ve been using the same method for years.
April 10, 2018 at 10:58 am #546569AntonApril 10, 2018 at 9:16 pm #546935TomLead DeveloperLead DeveloperIt looks like you uploaded your own Poppins font to your server, and are including it with
@font-face
.If you’re doing that, you don’t need to make a call to Google for the fonts.
Add “Poppins” as a system font using this filter: https://docs.generatepress.com/article/generate_typography_default_fonts/
Then you’ll be able to choose it from the System Fonts section of the typography dropdown in the Customizer.
April 10, 2018 at 9:45 pm #546952AntonHey Tom,
Yeah, it were the Elementor guys who did that.
Will follow your instructions when Elementor can’t solve the problem (which still seems to be an SSL issue).
cheers!
AntonApril 11, 2018 at 4:18 am #547164AntonI got this message from the hosting company:
I was able to access your dashboard and try to change the fonts from the Elementor builder, however, all fonts resulted in the same error. Then I tried to change your theme to one of the default WordPress ones and was able to modify the font without the bad request errors.
This indicates that the source of the issue is the current active theme generatepress. We would recommend you to get in touch with their developers and explain the issue. The developers of the theme have more knowldge on the source code of their tool and should be able to advise on a possible solution.
April 11, 2018 at 9:40 am #547531TomLead DeveloperLead DeveloperThey found that out because then GP isn’t loading Google Fonts. So if you do what I suggested above, the theme won’t load Google Fonts, and your local Poppins file will load.
April 12, 2018 at 1:07 am #548056AntonI added this to functions.php:
add_filter( ‘generate_typography_default_fonts’,’tu_add_system_fonts’ );
function tu_add_system_fonts( $fonts ) {
$fonts[] = ‘Poppins’;
return $fonts;
}I see the font in Customizer, but he can’t find the correct font.
Do I have to upload the fonts again and if so, in which folder?
April 12, 2018 at 9:20 am #548585TomLead DeveloperLead DeveloperHere’s what I’m seeing now: https://www.screencast.com/t/FmBZKyfwVui
Is that closer to what it should be?
April 12, 2018 at 9:30 am #548597AntonFor the main text yes, but I used other fonts for the menu, headers, widgets etc.
April 12, 2018 at 8:38 pm #548941TomLead DeveloperLead DeveloperHmm ok – let’s step back a bit.
First, remove the @font-face stuff from your CSS – let’s use the fonts directly from Google.
Once you do that, choose Poppins from the Google Fonts section in the Customizer.
If the text is too heavy, you can adjust the font weight and even the variants that come with the font.
Does that give you a different result at all?
April 15, 2018 at 11:20 pm #551328April 16, 2018 at 11:38 am #551942TomLead DeveloperLead DeveloperYou should see some blocks similar to that in your custom CSS – you said Elementor support added them? You should just be able to remove the blocks completely, or comment them out as shown in your screenshot.
April 16, 2018 at 8:53 pm #552248AntonJust found one more block in font awesome essentials.css, nothing to be found in custom css. Just deleted the uploaded fonts now.
But even then I have the same problem. It’s like the site keeps pointing to the same standard font. System fonts work, but no Google Fonts.
April 16, 2018 at 9:14 pm #552261TomLead DeveloperLead DeveloperWhat if you remove the font in your Elementor settings, and choose it in the GP settings? Customize > Typography > Body.
I’m not sure what Elementor does, but GP allows you to choose which variants and weights to load with the Google Font.
-
AuthorPosts
- You must be logged in to reply to this topic.