苏醒 苏醒
  • 首页
  • WP主题
  • WP插件
  • WP教程
  • 是日一记
  • 博客
    • 留言
    • 唠叨
    • 盆友圈
    • 栏目推荐

suxing

管理员
每天清晨有多少双眼睛睁开,有多少人的意识苏醒过来,便有多少个世界。
IP归属地: 广东
文章
214
评论
236
suxing
2015-12-30 11:49:08 广东

关于WordPress后台加载速度慢的问题

文章字数:1020
阅读时间: 3 分钟
智能摘要 DeepSeek
该问题主要因谷歌字体和头像加载问题导致,具体解决方案如下: 1. 禁止加载谷歌字体:在`functions_suxingme.php`或`add.php`中添加以下代码: ```php add_filter( 'gettext_with_context', 'disable_open_sans', 888, 4 ); function disable_open_sans( $translations, $text, $context, $domain ) { if ( 'Open Sans font: on or off' == $context && 'on' == $text ) { $translations = 'off'; } return $translations; } ``` 2. 解决头像问题:在`functions.php`中

有朋友说最近使用苏醒的主题,后台加载速度比较慢 😀 。

在这里说明下:最主要是两个因素造成的,一个是谷歌字体,一个是头像的问题。

使用苏醒主题的用户,只要把以下代码贴到functions_suxingme.php或者add.php即可 😛 。

其他朋友,自行添加到functions.php即可。

😐

[quote]谷歌字体[/quote]

后台加载谷歌字体也没什么卵用,所以直接把他禁止掉即可。

add_filter( 'gettext_with_context', 'disable_open_sans', 888, 4 );
function disable_open_sans( $translations, $text, $context, $domain ) {
if ( 'Open Sans font: on or off' == $context && 'on' == $text ) {
$translations = 'off';
}
return $translations;
}

[quote]解决Gravatar头像不显示的问题[/quote]

以下两个办法,二选一即可。

//官方Gravatar头像调用ssl头像链接
function suxingme_get_avatar($avatar) {
$avatar = preg_replace('/.*\/avatar\/(.*)\?s=([\d]+)&.*/','<img src="https://secure.gravatar.com/avatar/$1?s=$2" class="avatar avatar-$2" height="$2" width="$2">',$avatar);
return $avatar;
}
add_filter('get_avatar', 'suxingme_get_avatar');

//使用Gravatar头像服务的(HTTPS)加密线路
function suxingme_replace_avatar($avatar) {
$avatar = str_replace(array("www.gravatar.com", "0.gravatar.com", "1.gravatar.com", "2.gravatar.com"), "cn.gravatar.com", $avatar);
return $avatar;
}
add_filter( 'get_avatar', 'suxingme_replace_avatar', 10, 3 );
  • WordPress 教程
  • Gravatar头像
  • Gravatar头像无法显示
  • wordpress主题
  • wordpress教程
等 人表示很赞
7,684
0

评论

空空如也
suxing
suxing
2019-12-20 12:39:34 广东

推荐 解决WordPress 文章英文单词溢出/单词断词等问题

智能摘要 DeepSeek 本文指出WordPress中文主题开发中常出现的排版问题:长英文、长链接溢出,英文单词断行。解决方案包括:1)在文章内容样式表中增 ...
  • WordPress 教程
3,674 1
suxing
suxing
2016-04-23 9:55:54 广东

推荐 WordPress菜单导航功能设置教程

智能摘要 DeepSeek 初次使用WordPress主题建站时,建议按以下顺序操作:新建分类目录、几篇文章、页面、菜单和小工具,调整功能选项。特别提醒不要在 ...
  • WordPress 教程
  • WordPress导航教程
  • WordPress导航设置
  • wordpress教程
  • WordPress菜单教程
  • WordPress菜单设置
11,836 2
suxing
suxing
2016-04-22 9:25:04 广东

推荐 苏醒的WordPress主题更新包安装说明

智能摘要 DeepSeek 感谢选购苏醒WP主题的正版用户!每次更新主题包都凝聚了用户建议,使主题更完善。正版用户可通过以下方式获取更新包: 1. 登录网 ...
  • WordPress 教程
9,398 4
suxing
suxing
2016-06-28 13:59:47 广东

推荐 WordPress新建页面没有评论框

智能摘要 DeepSeek WordPress中评论框的问题:新建文章或页面时看不到评论框,无法开启或关闭。解决方法:点击文中的图片链接,进入编辑页面后,找到 ...
  • WordPress 教程
  • wordpress教程
7,663 0
suxing
suxing
2017-06-29 14:23:29 广东

推荐 WordPress上传的文件尺寸超过php.ini中定义的upload_max_filesize值解决方法

智能摘要 DeepSeek WordPress上传主题包时,若提示文件尺寸超过upload_max_filesize限制,需修改php.ini中的upload ...
  • WordPress 教程
13,049 0

我用的 WordPress 主题

2021 年单栏 WordPress 主题

Copyright © 2012-2025 苏醒. All rights reserved. Designed by nicetheme.
  • 首页
  • 主题
  • 教程
  • 博客
  • 唠叨
  • 留言