Support » Theme: Ef Practical » Load Google Fonts CSS local

  • Hello,

    because of the new GDPR and some unclear situations regarding Google Fonts, it is maybe more safe to load fonts locally – which is possible with EF Practical. My only problem currently is, that in functions.php:169 a CSS file gets loaded, which cannot be sourced locally.

    Is there a possibility to deliver this Google Fonts CSS using the same methods as the fonts itself?

    Thanks in advance, and thanks for this great theme!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Theme Author Dimitrakopoulos

    (@effpandim)

    Hi @wb7eu

    Thank you for using Ef Practical theme.

    You have to create a child theme and in the functions.php paste the following code:

    function efpractical_child_dequeue_google_fonts() {
        wp_dequeue_style( 'practical-fonts' );
    }
    add_action( 'wp_enqueue_scripts', 'efpractical_child_dequeue_google_fonts', 20 );

    Inform me if it works.

    Regards

    Yes, thank you!

    I have to ask again, because I’ve found another occurence of GFonts embedding:

    on my index.php is somewhere at the bottom the following code:

    <script type='text/javascript' src='https://my-domain.com/wp-content/themes/ef-practical/inc/kirki/modules/webfont-loader/vendor-typekit/webfontloader.js?ver=3.0.28'></script>
    <script type='text/javascript'>
    WebFont.load({google:{families:['Playfair Display:400:cyrillic,cyrillic-ext,devanagari,greek,greek-ext,khmer,latin,latin-ext,vietnamese,hebrew,arabic,bengali,gujarati,tamil,telugu,thai', 'PT Serif:400:cyrillic,cyrillic-ext,devanagari,greek,greek-ext,khmer,latin,latin-ext,vietnamese,hebrew,arabic,bengali,gujarati,tamil,telugu,thai']}});
    </script>

    Because of that, GFonts is loaded using the webfont-loader. The first mentioned solution only removes the direct embedding using css.

    I am using Ef Practical 1.1.1.

    Theme Author Dimitrakopoulos

    (@effpandim)

    Hi @wb7eu

    This appears because of the extension that is used so that the fonts of the theme can be changed.

    Regards

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