• 请不要在回答技术问题时复制粘贴 AI 生成的内容
hfeeki
V2EX  ›  程序员

wordpress3.8 如何禁用 google 字体?

  •  
  •   hfeeki · Jun 24, 2014 · 5794 views
    This topic created in 4529 days ago, the information mentioned may be changed or developed.
    在wordpress的网站下载了disable google font 这个插件,安装了,但是没有效果
    21 replies  •  2014-11-16 10:02:44 +08:00
    gangsta
    gangsta
    Jun 24, 2014
    1
    在functions.php写个函数就OK了

    Google : WP remove open sans
    XXOO
    XXOO
    Jun 24, 2014
    3
    不是有360 镜像么
    shiniv
    shiniv
    Jun 24, 2014
    4
    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;
    }
    }
    $disable_google_fonts = new Disable_Google_Fonts;
    decken
    decken
    Jun 24, 2014
    6
    一开始我还以为是哪个插件带的, 排查了老半天也没查出来
    qinix
    qinix
    Jun 24, 2014 via iPhone
    7
    chian
    chian
    Jun 24, 2014
    9
    直接注释掉这一段
    // $open_sans_font_url = "//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,300,400,600&subset=$subsets";

    路径wp-includes\script-loader.php
    notcome
    notcome
    Jun 25, 2014 via iPhone
    10
    这是样式写入 PHP 嘛……
    coolicer
    coolicer
    Jun 25, 2014
    11
    我那是主题加的,我直接去CSS去掉。
    hisway
    hisway
    Jun 25, 2014
    12
    主题中查找到fonts.googleapis.com这段,直接替换成国内的字体库,百度,360都有,很好用。
    johnnyR
    johnnyR
    Jun 25, 2014❤️1
    13
    这个问题这几天很火,这是我的收集: http://dalongmao.sinaapp.com/archives/144
    kingme
    kingme
    Jun 25, 2014
    14
    安装插件,disable google font
    hfeeki
    hfeeki
    OP
    Jun 25, 2014
    15
    @kingme 我上面说过,插件不起作用
    hfeeki
    hfeeki
    OP
    Jun 25, 2014
    16
    @hisway 怎么替换?
    谁知道怎样替换成本地字体?
    hfeeki
    hfeeki
    OP
    Jun 25, 2014
    17
    @XXOO 360的镜像在哪里?怎样替换成360的镜像?
    hfeeki
    hfeeki
    OP
    Jun 25, 2014
    18
    @belin520 谷歌现在国内都没法上了,你还弄个谷歌的链接,你这样会让我更加抑郁的~^~
    trigger
    trigger
    Jun 25, 2014
    19
    @johnnyR 解决了 进后台很快
    itfanr
    itfanr
    Nov 16, 2014
    21
    @X-Force 好用 谢谢!
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1126 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 108ms · UTC 18:02 · PVG 02:02 · LAX 10:02 · JFK 13:02
    ♥ Do have faith in what you're doing.