每次Wordpress更新后都发现打开很困难,甚至打不开。在这里整理一下,方便大家查询。
1. 加速访问,屏蔽google的URL
打开wp-includes\script-loader.php文件,找到$open_sans_font_url = “//fonts.googleapis.com/css 一行,双斜杠注释掉
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
if ( 'off' !== _x( 'on', 'Open Sans font: on or off' ) ) { $subsets = 'latin,latin-ext'; /* translators: To add an additional Open Sans character subset specific to your language, * translate this to 'greek', 'cyrillic' or 'vietnamese'. Do not translate into your own language. */ $subset = _x( 'no-subset', 'Open Sans font: add new subset (greek, cyrillic, vietnamese)' ); if ( 'cyrillic' == $subset ) { $subsets .= ',cyrillic,cyrillic-ext'; } elseif ( 'greek' == $subset ) { $subsets .= ',greek,greek-ext'; } elseif ( 'vietnamese' == $subset ) { $subsets .= ',vietnamese'; } // Hotlink Open Sans, for now <span style="color: #ff0000;" data-mce-style="color: #ff0000;">//$open_sans_font_url = "//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,300,400,600&subset=$subsets";</span> } |
2. 显示Gavatar头像
升级至4.2.1之后的版本,头像服务器函数移到了 “\wp-includes\link-template.php” (3604,29): $url = sprintf( ‘http://%d.gravatar.com/avatar/%s’, $gravatar_server, $email_hash ),如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
$url_args = array( 's' => $args['size'], 'd' => $args['default'], 'f' => $args['force_default'] ? 'y' : false, 'r' => $args['rating'], ); $url = sprintf( 'http://%d.gravatar.com/avatar/%s', $gravatar_server, $email_hash ); $url = add_query_arg( rawurlencode_deep( array_filter( $url_args ) ), set_url_scheme( $url, $args['scheme'] ) ); |
将sprintf这一行改为下面即可
1 |
$url = sprintf( 'https://secure.gravatar.com/avatar/%s', $email_hash ); |
0 Comments