- This topic has 6 replies, 2 voices, and was last updated 5 years, 9 months ago by Tom.
-
AuthorPosts
-
July 4, 2018 at 7:44 am #615206Kommunikationsbeauftragter
Hi,
Im trying to get multiple fonts to work for hours now. The problem I have, is that if I add multiple local fonts the way described here: https://generatepress.com/forums/topic/custom-fonts-how-to-add-multiple-fonts-and-how-to-limit-the-weights/
only the first font declared in my functions.php works.<?php /** * GeneratePress child theme functions and definitions. * * Add your custom PHP in this file. * Only edit this file if you have direct access to it on your server (to fix errors if they happen). */ function generatepress_child_enqueue_scripts() { if ( is_rtl() ) { wp_enqueue_style( 'generatepress-rtl', trailingslashit( get_template_directory_uri() ) . 'rtl.css' ); } } add_filter( 'generate_typography_default_fonts','tu_add_system_fonts' ); function tu_add_system_fonts( $fonts ) { $fonts[] = 'Lato'; /*only this one ist working*/ $fonts[] = 'Reem Kufi'; return $fonts; }
They both show up in the typography system fonts dropdown menu, but the second one (reem kufi) doesnt changes the texts look to times new roman. If I change their order in the php(so reem kufi is declared first and then lato) reem kufi works, but the lato font stops to work. Thats why i think there is a problem in my php and not in my css.
Greetings from Germany
Elias
July 4, 2018 at 3:30 pm #615655KommunikationsbeauftragterCan’t anyone help me?
July 4, 2018 at 3:41 pm #615670TomLead DeveloperLead DeveloperHi there,
Can you share the
@font-face
CSS that you’re using as well?You can find updated docs here: https://docs.generatepress.com/article/adding-local-fonts/
July 5, 2018 at 9:00 am #616283KommunikationsbeauftragterOf course ๐
(edit: ive deleted it because it was pointing to sort of an official website. I had a typo in the url pointing to the font)
This is my css. I have tried it both through the Simple CSS plugin and the child themes style.css. With none of them both fonts worked…
(Thanks for sharing the documentation. I followed every step of it (before post 1) but I can’ get both fonts to work at the same time)
July 5, 2018 at 9:46 am #616338TomLead DeveloperLead DeveloperCan you confirm that the URL to the files are correct? I’m seeing these console errors on your website: https://www.screencast.com/t/1JFU4LzX1d
July 5, 2018 at 11:53 am #616469KommunikationsbeauftragterThanks for your help! It was just a simple typo in the URL (wp_content instead of wp-content and a missing /themes inside…)
Elias
July 5, 2018 at 9:22 pm #616839TomLead DeveloperLead DeveloperGlad I could help! ๐
-
AuthorPosts
- You must be logged in to reply to this topic.