卡卡卡的wordpress

安装卡,前台卡,后台卡,头像卡,卡卡卡

一.安装多次,始终打不开安装页面,改天试了下好,我也不知道怎么回事

二.前台卡,后台卡

多半是谷歌字体和Gravatar头像的问题,打开主题的 functions.php 文件,拉到最下面,在最后一个 ?> 之前加入如下代码:(PS:修改 functions.php 文件一定要小心,如果你不能保证一定不会出现语法错误请先备份,不然一旦出现语法错误网站就打不开了,需要用FTP将修改前的文件上传覆盖)

禁用谷歌字体

1
2
3
4
5
6
7
8
9
10
11
12
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;

替换Gravatar头像

1
2
3
4
5
6
7
8
function  dmeng_get_https_avatar( $avatar ) {
     //~ 替换为 https 的域名
     $avatar  str_replace ( array ( "www.gravatar.com" "0.gravatar.com" "1.gravatar.com" "2.gravatar.com" ),  "secure.gravatar.com" $avatar );
     //~ 替换为 https 协议
     $avatar  str_replace ( "http://" "https://" $avatar );
     return  $avatar ;
}
add_filter( 'get_avatar' 'dmeng_get_https_avatar' );

 

 

参考地址一:(解决前后台卡)http://jingyan.baidu.com/article/4f7d5712aaca631a20192720.html

参考地址二(解决后台卡,头像被墙):

http://zhidao.baidu.com/link?url=I4PjwFNFURPq2p4BRQ12REp595CRZZZWpH4yVOPy_FpbZXXbDEkcj91WNGHmwNILRnDIinT-GxdqN91ZXJftFrugX9-_5uBEsr6Dq_SuCxS

总结:

1。打开wp-include/function.php 添加

function coolwp_remove_open_sans_from_wp_core() {
wp_deregister_style( ‘open-sans’ );
wp_register_style( ‘open-sans’, false );
wp_enqueue_style(‘open-sans’,”);
add_action( ‘init’, ‘coolwp_remove_open_sans_from_wp_core’ );

}

2.全局,全站搜索googleapis.com ,替换为useso.com

3.打开wp-config.php

加入一行代码,来关闭自动更新功能,这行代码放在数据库信息后面即可:

define(‘AUTOMATIC_UPDATER_DISABLED’, true );

4.打开模版所在的function.php (注意,该文件在模版目录里,当前我的是fifteen),加入该代码

function  dmeng_get_https_avatar( $avatar ) {
     //~ 替换为 https 的域名
     $avatar  str_replace ( array ( "www.gravatar.com" "0.gravatar.com" "1.gravatar.com" "2.gravatar.com" ),  "secure.gravatar.com" $avatar );
     //~ 替换为 https 协议
     $avatar  str_replace ( "http://" "https://" $avatar );
     return  $avatar ;
}
add_filter( 'get_avatar' 'dmeng_get_https_avatar' );
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值