Home Forums Pro Themes Clean Commerce Pro Clean Commerce Pro use fonts.googleapis.com/css

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #76583
    Allan Godard
    Participant

    Hello,

    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 link

    https://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

    #76665
    wensolutions
    Keymaster

    Hello @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/ir1f86

    Step 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/ir1gsq

    Hope this helps.

    Regards!!

    #76671
    Allan Godard
    Participant

    Hello,

    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

    #76789
    Allan Godard
    Participant

    Hello,

    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

    #76795
    wensolutions
    Keymaster

    Hello @allan69830,

    The code will work so please add the code through the child theme and verify.

    Thank you.

    Regards!!

    #76796
    Allan Godard
    Participant

    Hello,

    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

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.