• Resolved arnoinnz

    (@arnoinnz)


    Hi,

    this is my first time seeking help on this forum and I’m a bit stumped.

    I’m developing a WooCommerce shop using the Storefront theme. Because this shop will be located in Germany I need to get rid of all Google Font instances due to the strict data security laws.

    There’s one instance of Google Fonts I can’t get rid off no matter what I try.

    It loads from the class-storefront.php file and comes from the following code on line 383:
    public function google_fonts() {
    $google_fonts = apply_filters(
    ‘storefront_google_font_families’,
    array(
    ‘source-sans-pro’ => ‘Source+Sans+Pro:400,300,300italic,400italic,600,700,900’,
    )
    );

    $query_args = array(
    ‘family’ => implode( ‘|’, $google_fonts ),
    ‘subset’ => rawurlencode( ‘latin,latin-ext’ ),
    );

    $fonts_url = add_query_arg( $query_args, ‘https://fonts.googleapis.com/css’ );

    return $fonts_url;
    }

    Has anyone got an idea how to write a snippet for the functions.php file of my child theme to unload the fonts?

    Any help would be much appreciated.

    Kind regards
    Arno

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter arnoinnz

    (@arnoinnz)

    Hi,

    I solved it with this:

    ?add_action( ‘wp_enqueue_scripts’, ‘aw_replace_font’, 99 );
    function aw_replace_font() {
    wp_dequeue_style( ‘storefront-fonts’ );
    }

    Kind regards,
    Arno

    Saif

    (@babylon1999)

    Hello @arnoinnz,

    Thank you for sharing the solution, this will benefit anyone landing on the ticket in the future. ??

    Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Unload Google Fonts’ is closed to new replies.