admin管理员组文章数量:1392003
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/
本文标签: javascriptHow to remove all google fonts in diviStack Overflow
版权声明:本文标题:javascript - How to remove all google fonts in divi? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744774564a2624547.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论