Home › Forums › Pro Themes › Clean Commerce Pro › Clean Commerce Pro use fonts.googleapis.com/css
- This topic has 5 replies, 2 voices, and was last updated 6 years, 1 month ago by
Allan Godard.
-
AuthorPosts
-
July 30, 2018 at 8:35 am #76583
Allan Godard
ParticipantHello,
I use the clean Commerce Pro theme and in this theme we use a google fonts api.
To improve my site i would like to add the font directly in my child theme and remove the linkhttps://fonts.googleapis.com/css?family=Rajdhani:400italic,700italic,300,400,500,600,700|Open+Sans:400italic,700italic,300,400,500,600,700&subset=latin,latin-ext.
What is your recommendation and the code to do that?
Thank you for your support.
Best regards
Allan
July 31, 2018 at 7:51 am #76665wensolutions
KeymasterHello @allan69830,
First of all thank you very much for using the theme.
Now if you want to directly load the font through the child theme then you can dequeue the fonts from the parent theme functions through the child theme.
Further to use your desired font at first you need to load it at first and to load the font please follow below given steps:
step 1: Go to this link :https://fonts.google.com/ and click the “+” sign of your desired font.
Screenshot:
http://prntscr.com/ir1f86Step 2: After clicking on the “+” sign, you will get the box at the bottom right corner. Click it then a box will appear. Here go to import tab and copy the import code and fonts below it and paste them in Admin Panel > Appearance > Customize > Additional CSS.
Screenshots:
http://prntscr.com/ir1gsqHope this helps.
Regards!!
July 31, 2018 at 11:29 am #76671Allan Godard
ParticipantHello,
Thank you for your reply.
I’m sorry but your proposal doesn’t work because my css is charged before your custom css font.
The function clean_commerce_add_theme_custom_font_css charge the font directly in the head after my style.css.Best regards.
Allan
August 2, 2018 at 3:17 am #76789Allan Godard
ParticipantHello,
Finally i have add this function
add_action (‘wp_head’, ‘remove_web_font’, 10);
function remove_web_font () {
remove_action (‘clean_commerce_action_theme_custom_css’, ‘clean_commerce_add_theme_custom_font_css’);
}What do you think about this practice?
Thank you for your help,
Best regards
Allan
August 2, 2018 at 4:49 am #76795wensolutions
KeymasterHello @allan69830,
The code will work so please add the code through the child theme and verify.
Thank you.
Regards!!
August 2, 2018 at 5:06 am #76796Allan Godard
ParticipantHello,
This code work but when i refresh the site, the navigator charge the wen css and after my css. Isn’t fluid.
Best regards.
Allan
-
AuthorPosts
- You must be logged in to reply to this topic.