During the new GDPR (DSGVO in Germany). We have to remove all the google fonts (if loaded from google).
To do so I searched a little in the SC of Divi.
For all of you who need a quick fix.
Here is something for you're functions.php
(child theme please)
// REMOVE ALL DIVI GOOGLE FONTS FROM DIVI
function et_builder_get_google_fonts() {return array();}
function et_get_google_fonts() {return array();}
function disable_gfonts_divi() {
wp_dequeue_style( 'divi-fonts' );
wp_dequeue_style('et-builder-googlefonts');
wp_dequeue_style('et-builder-googlefonts-cached');
}
add_action( 'wp_enqueue_scripts', 'disable_gfonts_divi', 20 );
// END GOOGLE FONTS REMOVE
During the new GDPR (DSGVO in Germany). We have to remove all the google fonts (if loaded from google).
To do so I searched a little in the SC of Divi.
For all of you who need a quick fix.
Here is something for you're functions.php
(child theme please)
// REMOVE ALL DIVI GOOGLE FONTS FROM DIVI
function et_builder_get_google_fonts() {return array();}
function et_get_google_fonts() {return array();}
function disable_gfonts_divi() {
wp_dequeue_style( 'divi-fonts' );
wp_dequeue_style('et-builder-googlefonts');
wp_dequeue_style('et-builder-googlefonts-cached');
}
add_action( 'wp_enqueue_scripts', 'disable_gfonts_divi', 20 );
// END GOOGLE FONTS REMOVE
If one of you has some to add or if it could be done a little nicer please tell me.
Share Improve this question edited Jun 4, 2018 at 8:52 Partha 4024 silver badges15 bronze badges asked Jun 4, 2018 at 8:21 Axel LodygaAxel Lodyga 111 silver badge3 bronze badges2 Answers
Reset to default 6In recent Divi update, this theme es with an option to enable or disable the google font.
You can get that option in Divi > theme option > general settings. Please go to Divi > theme option > General settings > Use Google font > Disable the option > save and check
An alternative to disabling Google Fonts is, to embed those fonts in your WordPress website.
I've created a plugin for that, which solves that GDPR requirement and integrates smoothly with Divi. All you need to do is:
- Install the plugin GDPR Cache Scripts & Styles
- Activate the plugin
- Wait 4-5 minutes for the plugin to download all fonts
Full plugin link: https://wordpress/plugins/gdpr-cache-scripts-styles/
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744774564a4592967.html
评论列表(0条)