关于Godaddy广告导致的WordPress后台错位解决方案

转自:willywei818的博客大巴空间

godaddy的广告代码破坏了wordpress后台的css样式表及js,导致后台显示不正常,在wordpress\wp-includes\script-loader.php中修改:
找到print_admin_styles()及_print_scripts()函数,

将print_admin_styles()中的

echo “<link rel=’stylesheet’ href='” . esc_attr($href) . “‘ type=’text/css’ media=’all’ />\n”;

更改为

$css = @file_get_contents($href);

echo “<style type=’text/css’>\n”.substr($css,0,-184).”</style>”;

将_print_scripts()中的

echo “<script type=’text/javascript’ src='” . esc_attr($src) . “‘></script>\n”;

替换为

$js = @file_get_contents($src);

echo “<script type=’text/javascript’>\n”.substr($js,0,-184).”</script>\n”;

3 thoughts on “关于Godaddy广告导致的WordPress后台错位解决方案

Leave a Reply to yangliu Cancel reply

Your email address will not be published. Required fields are marked *