Skip to content

Instantly share code, notes, and snippets.

@hostz-frank
Last active March 13, 2018 11:05
Show Gist options
  • Save hostz-frank/8ccb5d86fc7b7353e797c90bf795a36b to your computer and use it in GitHub Desktop.
Save hostz-frank/8ccb5d86fc7b7353e797c90bf795a36b to your computer and use it in GitHub Desktop.
Im Divi-Theme das Laden externer Google-Fonts abschalten. / Disable external pulled web fonts from Google for the Divi theme
<?php
// Copy the code below into your Divi child(!) theme's functions.php
/**
* Disable external font load from Google.
*
* Useful after putting Google fonts on your own server;
* see https://google-webfonts-helper.herokuapp.com/fonts
*/
add_action( 'wp_enqueue_scripts', 'disable_external_divi_font_load', 12 );
function disable_external_divi_font_load() {
wp_dequeue_style( 'divi-fonts' );
}
// Fallback:
if( ! function_exists( 'et_divi_fonts_url' ) ):
function et_divi_fonts_url() {
return '';
}
endif;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment