wordpress不加载Google fonts的几种办法

来源:互联网 发布:网络编程实用教程第3版 编辑:程序博客网 时间:2024/05/17 01:07

wordpress不加载Google fonts的几种办法

一、安装Disable Google Font插件,但经过测试之后,没有明显效果。(不推荐)。

二、注释或删除掉style.css和function.php有关加载Google字体的代码fonts.googleapis.com即可。

三、将以下代码添加到主题目录下的functions.php中

        if(!class_exists('Disable_Google_Fonts')):
       class Disable_Google_Fonts {
       public function __construct() {
       add_filter( 'gettext_with_context', array( $this, 'disable_open_sans' ), 888, 4 );
       }
      public function disable_open_sans( $translations, $text, $context, $domain ) {
      if ( 'Open Sans font: on or off' == $context && 'on' == $text ) {
      $translations = 'off';
      }
      return $translations;
     }
     }
     endif;
     $disable_google_fonts = new Disable_Google_Fonts;

0 0
原创粉丝点击