- This topic has 12 replies, 2 voices, and was last updated 7 years, 5 months ago by Tom.
-
AuthorPosts
-
October 14, 2016 at 7:14 am #235228Krzysztof
After update GP Premium to 1.2.90 and GP theme to 1.3.40 I have problem with Google font on my site. Before update font was linked by:
<link rel=’stylesheet’ id=’generate-fonts-css’ href=’//fonts.googleapis.com/css?family=Roboto:100,100italic,300,300italic,regular,italic,500,500italic,700,700italic,900,900italic&subset=latin-ext’ type=’text/css’ media=’all’/>
Now I see:
<link rel=’stylesheet’ id=’generate-fonts-css’ href=’//fonts.googleapis.com/css?family=Roboto&subset=latin-ext’ type=’text/css’ media=’all’ />
Where is definition for font weight? How to fix it?
October 14, 2016 at 7:24 am #235233KrzysztofSame wired thins in code, e.g. inline style for H1 after update:
h1 {
font-family: “Roboto”,;
font-weight: 300;
text-transform: uppercase;
font-size: 21px;
}And this same before:
h1 {
font-family: “Roboto”, sans-serif;
font-weight: 300;
text-transform: uppercase;
font-size: 21px;
}Where is sans-serif now? This update just ruined my page :/
October 14, 2016 at 7:51 am #235250KrzysztofFirst problem fixed itself by editing and seveing theme options again BUT link to Google font still look strange:
<link rel='stylesheet' id='generate-fonts-css' href='//fonts.googleapis.com/css?family=Roboto:100,100italic,300,300italic,regular,italic,500,500italic,700,700italic,900,900italic|Roboto&subset=latin-ext' type='text/css' media='all' />
October 14, 2016 at 8:39 am #235269TomLead DeveloperLead DeveloperHi there,
The way the theme gets the font variants and categories improved drastically in the latest version.
The category and variants should have populated on first load of your Dashboard (typically after the update).
It didn’t for you, which could be caused by using a child theme with manual filters for the fonts – not sure if that’s the case?
As for the second issue, are you using any custom functions dealing with the fonts?
October 14, 2016 at 8:41 am #235273KrzysztofTom, I use my own child theme and I don’t see category and variants. I use only filter “generate_fonts_subset” to add “latin-ext”.
October 14, 2016 at 8:45 am #235277TomLead DeveloperLead DeveloperCan you share you code so I can test it?
October 14, 2016 at 8:52 am #235279KrzysztofI sent it in the email to You. Anyway, I found in my child theme have missing some options in filter “generate_font_option_defaults” (font_body_category and font_body_variants), I added it and there is no changes in look.
October 14, 2016 at 9:02 am #235281TomLead DeveloperLead DeveloperThose are the new fields.
Before, every time you loaded your page GP looked through all of the Google Fonts and grabbed the variants and category.
Now, those values are set once, so we don’t have to look at 800+ fonts. Very happy with this change.
October 14, 2016 at 9:35 am #235290TomLead DeveloperLead DeveloperLooks like making some adjustments to the child theme functions have fixed this issue 🙂
October 31, 2016 at 11:27 am #240413Krzysztof@Tom, where information about font_body_variants is stored? I changed it from “100,100italic,300,300italic,regular,italic,500,500italic,700,700italic,900,900italic” to “100,100italic,300,300italic,regular,italic,500,500italic” and in page source still is previous value…
October 31, 2016 at 7:50 pm #240554TomLead DeveloperLead DeveloperWhen you select fonts in the Customizer, two hidden fields are automatically populated with the data attached to the font you choose.
For now, these fields will stay hidden, but the variants might become visible one day.
For now, you can do this:
add_action('customize_controls_print_styles', 'tu_customize_preview_css'); function tu_customize_preview_css() { ?> <style> .customize-control.customize-control-gp-hidden-input {display: block !important;} </style> <?php }
That will display the fields so you can adjust them as needed.
It’s required to have something in each field.
Hope this helps!
November 2, 2016 at 1:20 am #240995KrzysztofThe problem is that I don’t use Customizer, I just updated child theme setting via php. Any way, I deleted theme options in database (field theme_mods_{theme-name}) and now my changes works.
November 2, 2016 at 9:19 am #241114TomLead DeveloperLead DeveloperLet me know if that works long term – there is a method in place that automatically sets them based on your chosen font if nothing exists in those fields.
However, that shouldn’t happen if you have your font set in the defaults function along with the variants for that font.
-
AuthorPosts
- You must be logged in to reply to this topic.