首页 > Web开发 > 详细

WordPress 后台禁用Google Open Sans字体,加速网站

时间:2014-10-20 22:37:30      阅读:381      评论:0      收藏:0      [点我收藏+]

解决方法很简单,安装启用 Disable Google Fonts 或者 Remove Open Sans font Link from WP core 其中之一即可。或者如果你没有使用WP自带的官方主题,那你添加下面的代码到当前所用的主题的 functions.php 中即可:

/**
 * WordPress 后台禁用Google Open Sans字体,加速网站
 * http://www.wpdaxue.com/disable-google-fonts.html
 */
add_filter( ‘gettext_with_context‘, ‘wpdx_disable_open_sans‘, 888, 4 );
function wpdx_disable_open_sans( $translations, $text, $context, $domain ) {
  if ( ‘Open Sans font: on or off‘ == $context && ‘on‘ == $text ) {
    $translations = ‘off‘;
  }
  return $translations;

用Open Sans 字体教程:

将WordPress后台的open-sans字体加载源从Google Fonts换为360 CDN

http://www.wpdaxue.com/disable-google-fonts.html

WordPress 后台禁用Google Open Sans字体,加速网站

原文:http://www.cnblogs.com/wawahaha/p/4038745.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!