- This topic has 13 replies, 4 voices, and was last updated 3 years, 8 months ago by
Tom.
-
AuthorPosts
-
August 30, 2018 at 6:10 am #664238
Maria Andrea
Hello, I would like to add a new font. I am working my page with Elementor. I am using Grand Hotel font in all pages and its is working; but, when I use it with woocommerce it doesn´t work. I realized that this type of font is not included in Generate press. I need your help to add Gran Hotel font.
Thanks so much
Maria Andrea
August 30, 2018 at 6:46 am #664263David
StaffCustomer SupportHi Maria,
this article explains how to:
https://docs.generatepress.com/article/adding-local-fonts/
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/August 30, 2018 at 8:09 am #664443Maria Andrea
Thanks so much for your answer. I made the different steps given in the link you shared me. However, I couldn´t include the font in the customize list. I don´t know where to copy and paste the following in order to include the font in the list:
add_filter( ‘generate_typography_default_fonts’, ‘tu_add_local_fonts’ );
function tu_add_local_fonts( $fonts ) {
$fonts[] = ‘Grand Hotel’;
return $fonts;
}Grand Hotel is the font I wanted to add.
When I copy and paste in the CSS additional, its appear an error (X expected RBRACE at line 38, col 1.), (X expected RBRACE at line 39, col 10.) (X expected RBRACE at line 41, col 12.)
Thanks so much for your help
Maria Andrea
August 30, 2018 at 9:46 am #664531Leo
StaffCustomer SupportThe filter part should be added with one of these methods:
https://docs.generatepress.com/article/adding-php/Code snippets plugin is the easiest if you aren’t using a child theme.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/September 12, 2018 at 7:25 pm #675911Maria Andrea
I could not add the php with Code snippets. Do you have a video to add a new font I could not include the font in the customize list. The font is showed in all pages except in the shop and product pages.
I hope you can help me
Maria Andrea
September 12, 2018 at 7:52 pm #675924Tom
Lead DeveloperLead DeveloperHi there,
Grand Hotel is a Google font, so you’d need to use this function:
add_filter( 'generate_typography_customize_list', function( $fonts ) { $fonts[ 'grand_hotel' ] = array( 'name' => 'Grand Hotel', 'variants' => array(), 'category' => 'cursive' ); return $fonts; } );
That should add the font to the very bottom of the Google Fonts section.
Let me know 🙂
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentSeptember 16, 2018 at 2:58 pm #678761Maria Andrea
Hello,
Following your instructions I tried to include the paragraph in the php file, but it did not allow me. I am sending a picture of what I tried to do.
https://drive.google.com/open?id=1UOzME1SobBcN9plMrNHO0hYHfNB3xDAv
Is it possible that I give you a temporary log in in order to fix it or what can I do? I feel frustrated because my web is almost done except with this problem of the font and I need to publish it.
Thanks,
Maria Andrea
September 16, 2018 at 5:06 pm #678810Leo
StaffCustomer SupportWhat does that message say? It’s an image so I couldn’t copy and paste into Google translate.
I tested Tom’s code above and successfully added the font.
Let me know 🙂
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/September 16, 2018 at 5:49 pm #678819Maria Andrea
The message says:
No ha sido posible comunicar con el sitio para comprobar los errores fatales, así que el cambio de PHP se ha revertido. Tendrás que subir el cambio del archivo PHP por otros medios, como por ejemplo usando SFTP.
It has not been possible to communicate with the site to check for fatal errors, so the PHP change has been reversed. You will have to upload the PHP file change by other means, such as using SFTP
Best regard,
Maria Andrea
September 16, 2018 at 6:44 pm #678837Tom
Lead DeveloperLead DeveloperThat’s strange, maybe your host is using an old version of PHP.
Try this instead:
add_filter( 'generate_typography_customize_list', 'tu_add_custom_g_font' ); function tu_add_custom_g_font( $fonts ) { $fonts[ 'grand_hotel' ] = array( 'name' => 'Grand Hotel', 'variants' => array(), 'category' => 'cursive' ); return $fonts; }
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentSeptember 16, 2018 at 6:57 pm #678840Maria Andrea
Hello,
My host is Webempresa.
I just tried, and appears the same error
https://drive.google.com/open?id=1vzliQYt03g2i7ADoYxdhcvz5zc0WjP7M
Best regard,
Maria Andrea
September 16, 2018 at 8:48 pm #678870Tom
Lead DeveloperLead DeveloperThat’s really strange. It’s hard to know what’s going on without a more detailed error message. It may be worth contacting your hosting company to ask them to check the
error_log
file. It should contain a more detailed error message that will allow us to debug further.You could also try a plugin like this instead if your child theme, just to test: https://wordpress.org/plugins/code-snippets/
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentSeptember 17, 2018 at 1:16 pm #679567Maria Andrea
Hello:
I just wrote my hosting Webempresa. I tried with Code snippets. But i didn´t work.Once I have an answer I will write you.
Thanks
Maria Andrea
September 17, 2018 at 8:28 pm #679759Tom
Lead DeveloperLead DeveloperSounds good, I’ll be here 🙂
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-development -
AuthorPosts
- You must be logged in to reply to this topic.