刚开始装了‘Disable Google Fonts’ 这个插件,根本没有作用,所以还是手动修改吧
找到wp-includes下面的script-loader.php,查找字符串 ‘ajax.googleapis.com’ 找到下面那段代码
把下面这段全部屏蔽掉在前面加//
或者直接替换掉
$scripts->add( 'prototype', '//cdn.cdnjs.net/prototype/1.7.1.0/prototype.js', array(), '1.7.1');
$scripts->add( 'scriptaculous-root', '//cdn.cdnjs.net/scriptaculous/1.9.0/scriptaculous.js', array('prototype'), '1.9.0');
$scripts->add( 'scriptaculous-builder', '//cdn.cdnjs.net/scriptaculous/1.9.0/builder.js', array('scriptaculous-root'), '1.9.0');
$scripts->add( 'scriptaculous-dragdrop', '//cdn.cdnjs.net/scriptaculous/1.9.0/dragdrop.js', array('scriptaculous-builder', 'scriptaculous-effects'), '1.9.0');
$scripts->add( 'scriptaculous-effects', '//cdn.cdnjs.net/scriptaculous/1.9.0/effects.js', array('scriptaculous-root'), '1.9.0');
$scripts->add( 'scriptaculous-slider', '//cdn.cdnjs.net/scriptaculous/1.9.0/slider.js', array('scriptaculous-effects'), '1.9.0');
$scripts->add( 'scriptaculous-sound', '//cdn.cdnjs.net/scriptaculous/1.9.0/sound.js', array( 'scriptaculous-root' ), '1.9.0' );
$scripts->add( 'scriptaculous-controls', '//cdn.cdnjs.net/scriptaculous/1.9.0/controls.js', array('scriptaculous-root'), '1.9.0');
解决jquery-ui.css,找到wp-includes下面的functions.php文件,在最下面添加如下代码,思路就是替换
function hc_cdn_callback($buffer) {
return str_replace('cdn.bootcss.com/jqueryui/1.12.1/jquery-ui.min.css', 'cdn.bootcss.com/jqueryui/1.12.1/jquery-ui.min.css', $buffer);//主要是修改这行
}
function hc_buffer_start() {
ob_start("hc_cdn_callback");
}
function izt_buffer_end() {
ob_end_flush();
}
add_action('init', 'hc_buffer_start');
add_action('shutdown', 'hc_buffer_end');