Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #1117995

    Hi,
    I have added the following code to my functions.php of my child theme but it does not work. Google fonts still loading (testet with Chrome developer console).

    add_action( 'init', 'enfold_customization_switch_fonts' );
    function enfold_customization_switch_fonts() {
        global $avia;
        $avia->style->print_extra_output = false;
    }

    Any ideas why and how to solve that?

    Best regards,
    Mathuseo

    #1118158

    Hey Marcel,

    Could you please give us a link to your website, we need more context to be able to help you.

    Best regards,
    Victoria

    #1118268

    Hi Victoria,

    you can found all the information in private content area.

    Thanks,
    Mathuseo

    #1118292

    Hi Mathuseo,

    Best regards,
    Victoria

    #1118691

    Hi Victoria,

    Best regards,
    Mathuseo

    • This reply was modified 11 months, 3 weeks ago by  Mathuseo.
    #1118888

    Hi Mathuseo,

    Best regards,
    Victoria

    #1119120

    Hi Victoria,

    Best Regads,
    Mathuseo

    #1119530

    Hi,

    Thank you for the update.

    This filter should prevent the google font script from rendering.

    
    add_filter( 'avf_output_google_webfonts_script', 'avf_output_google_webfonts_script', 10, 1 );
    
    function avf_output_google_webfonts_script( $activate )
    {
    	return false;
    }

    // https://kriesi.at/support/topic/disable-google-font-loading-via-google/#post-969672

    Best regards,
    Ismael

    #1120837

    Hi Ismael,

    it works, thank you. Any idea why it does not work on my other website?

    For further informaton please see private content below.

    Best regards,
    Mathuseo

    #1121034

    Hi,

    It should work for both web sites, I do not see the code on functions.php?

    Best regards,
    Basilis

    #1122881

    Hi Basilis,

    the code is in function.php of child theme of course. Location is themes/enfold-child/. Please check backend > design > editor.

    I add another website to private content. Here the code is not working as well. Google fonts is still loading. I have added the code to functions.php of child-theme as described above.

    Can you please check these both websites why it is not working?

    • This reply was modified 11 months, 1 week ago by  Mathuseo.
    #1122945

    Hi,
    I did checked the frontpage and Google Fonts is still loaded. I think that it could be because of Google Maps integration. On subpages, without Google Maps integration, Google Fonts is not loaded.

    I think that is the explanation of the problem.

    Any “Best practice” how to prevent loading Google Fonts with using Google Maps with Enfold?

    #1123027

    Hi,

    Why are you trying to disable the google fonts? If the purpose is to prevent the site from connecting to the Google API, then using a map from the same source renders it pointless. Removing the font from the map application doesn’t change the fact that the site is still connecting to the Google Map API. Are you trying to make the site GDPR-compliant?

    There is a way to prevent the default map font from loading but it’s not implemented in the theme.

    // https://stackoverflow.com/questions/25523806/google-maps-v3-prevent-api-from-loading-roboto-font

    Best regards,
    Ismael

Viewing 13 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic.