• Resolved lauge

    (@lauge)


    Hello,

    I would like to disable Google Fonts.

    I realize that this should be done using a child theme with a function added to functions.php in the child theme. But it is not clear to me what the exact content of this function should be.

    Base on this reply (for another theme); https://www.ads-software.com/support/topic/disable-google-fonts-for-gdpr/, I get the impression that wp_deregister_style should be used. Is this correct for the Chosen theme? Moreover, which handles are the relevant ones for the Chosen theme?

    Thanks,
    Lauge

Viewing 1 replies (of 1 total)
  • Theme Author Ben Sibley

    (@bensibley)

    Hi Lauge,

    Here’s a modified version of that function you can use for Chosen:

    function ct_chosen_child_remove_google_fonts() {
      wp_deregister_style( 'ct-chosen-google-fonts' );
    }
    add_action( 'wp_enqueue_scripts', 'ct_chosen_child_remove_google_fonts', 999);

    Chosen “registers” the Google Fonts script and this function “unregisters” it before it’s ever loaded so that the site never requests any external resources from Google.

Viewing 1 replies (of 1 total)
  • The topic ‘Disabling Google Fonts’ is closed to new replies.