- This topic has 13 replies, 2 voices, and was last updated 3 years, 1 month ago by David.
-
AuthorPosts
-
March 3, 2021 at 6:26 am #1680215Ulrich
Hi,
in an WP Site with GeneratePress Premium as Theme I would like to use a Google font (Piazolla) for the title (but not for the subtitle). The best would be to get this font added to the font-selection-menus, which I get in the costumizer for typography. There are some Goggle fonts, but not the Piazolla.
What to do?
Thanks a lot!
UlrichMarch 3, 2021 at 7:23 am #1680479DavidStaffCustomer SupportHi there,
this article provides the PHP Snippet required to add a google font to the Customizer list:
https://docs.generatepress.com/article/generate_typography_default_fonts/
March 3, 2021 at 8:26 am #1680563UlrichThat’s perfect, I got the Piazolla in the selection menu.
But unfortunately the selected font isn’t shown corectly in the frontend browser. To be more precise: in the chromium browser I get the right font, but not in firefox and even not in the safari.
Yes, that is another question, but may be I get help again here?
Greetings
UlrichMarch 3, 2021 at 8:57 am #1680618DavidStaffCustomer SupportCan you share a link to the site so we can see what the issue is?
March 3, 2021 at 9:07 am #1680630UlrichWe just talk about the word “LOGOS” at the top of the Site. All other text should use another font, Ubuntu.
March 3, 2021 at 10:04 am #1680683DavidStaffCustomer SupportI think its a spelling mistake in your font name, it should be:
Piazzolla
If this is the correct font:
https://fonts.google.com/specimen/Piazzolla?preview.text_type=customMarch 3, 2021 at 10:43 am #1680750UlrichSorry for wasting Your time with errors like this…
Thank You very mutch!
March 4, 2021 at 1:57 am #1681463DavidStaffCustomer SupportNo apologies necessary … glad to be of help!
March 4, 2021 at 12:16 pm #1682384UlrichOne more question came up: the (wrong) spelling solved the problem for firefox and chromium (both running on Linux), but not for a safari – a friend told me that. Is that possible? Sie the three screenshots in our nextcloud:
https://cg-2022.org/nc/index.php/s/W5ozWY6qKZGptSbUlrich
March 5, 2021 at 3:53 am #1682983DavidStaffCustomer SupportCan you link me to the site i can check on Safari
March 6, 2021 at 7:11 am #1684572UlrichMarch 6, 2021 at 6:23 pm #1685010DavidStaffCustomer SupportI am not seeing the font loading on any device.
The issue is that the Font is a Variable font and cannot be simply loaded by the Customizer.
Leave the settings and the functions you have so far.
Then add this snippet:add_action('wp_head', function() { ?> <link href="https://fonts.googleapis.com/css2?family=Piazzolla&display=swap" rel="stylesheet"> <?php });
March 7, 2021 at 3:45 am #1685224UlrichO.k., I added that (I do that using the WP Plugin Code Snippets. What I now have there is:
add_filter( 'generate_typography_default_fonts','tu_add_system_fonts' ); function tu_add_system_fonts( $fonts ) { $fonts[] = 'Piazzolla'; return $fonts; } add_action('wp_head', function() { ?> <link href="https://fonts.googleapis.com/css2?family=Piazzolla&display=swap" rel="stylesheet"> <?php });
To avoid a missunderstanding: there is only one single word on the site which uses the Piazzolla: That’s LOGOS at the top of the site.
March 7, 2021 at 6:45 am #1685367 -
AuthorPosts
- You must be logged in to reply to this topic.