欢迎来到 Android人的问与答 ,在这里提问或帮助他人解答。 Question2Answer的1.6.x和1.7.x版本的中文翻译包我修改更新:

Question2answer

如何使用中文语言包

Q2A 1.6.x - Chinese Simplified (简体中文)

Q2A 1.7.x - Chinese Simplified (简体中文)


国内服务器推荐 阿里云服务器
国外服务器推荐 DigitalOcean
VPN推荐 正版Green VPN
阿里云推荐码:ldvq50

WordPress 中 Google 字体的最佳替代方案

0 喜欢 0 不喜欢
765 浏览

下面所述基于:WordPress 4.1版本

主体思路是:

将 fonts.googleapis.com 替换为 fonts.useso.com (360网站缓存的Google 字体

具体方法如下:

好多网上的做法只是替换wp-includes/script-loader.php 文件中的fonts.googleapis.com 。这样是不全的。为啥?你搜一下就知道了。在WordPress根目录下搜索使用的地方:

[forlong401 wordpress]# grep -r "fonts.googleapis.com" .

./wp-includes/script-loader.php: // $open_sans_font_url = "//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,300,400,600&subset=$subsets";

./wp-includes/js/tinymce/plugins/compat3x/css/dialog.css:@import url(//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,300,400,600&subset=latin-ext,latin);

./wp-content/themes/twentyfourteen/functions.php: $font_url = add_query_arg( $query_args, '//fonts.googleapis.com/css' );

./wp-content/themes/twentyfifteen/functions.php: ), '//fonts.googleapis.com/css' );

./wp-content/themes/twentythirteen/functions.php: $fonts_url = add_query_arg( $query_args, "//fonts.googleapis.com/css" );

所以需要挨个替换。替换后的结果如下:

[forlong401 wordpress]# grep -r "useso" .

./wp-includes/script-loader.php: $open_sans_font_url = "//fonts.useso.com/css?family=Open+Sans:300italic,400italic,600italic,300,400,600&subset=$subsets";

./wp-includes/js/tinymce/plugins/compat3x/css/dialog.css:@import url(//fonts.useso.com/css?family=Open+Sans:300italic,400italic,600italic,300,400,600&subset=latin-ext,latin);

./wp-content/themes/twentyfourteen/functions.php: // licong changes fonts from googleapis to useso.

./wp-content/themes/twentyfourteen/functions.php: $font_url = add_query_arg( $query_args, '//fonts.useso.com/css' );

./wp-content/themes/twentyfifteen/functions.php:// licong changes fonts from googleapis to useso.

./wp-content/themes/twentyfifteen/functions.php: ), '//fonts.useso.com/css' );

./wp-content/themes/twentythirteen/functions.php:// licong changes fonts from googleapis to useso.

./wp-content/themes/twentythirteen/functions.php: $fonts_url = add_query_arg( $query_args, "//fonts.useso.com/css" );

 

最新提问 2月 16, 2015 分类:php | 用户: forlong401 (7,050 分)

登录 或者 注册 后回答这个问题。

...