$kernelink route --hydrate --safe

页面加载 /
跳到正文
auth://account/session

登录工作区

使用 Emlog 账户继续访问你的内容与互动记录。

忘记密码?

打开 Emlog 原生登录页

160.md
workspace / posts
~/posts/160.md 阅读中

WordPress 移除 head 代码 classic-theme-styles-inline-css 的方法

随着 WordPress 程序的不断更新,越来越多的冗余代码出现在了源码的 head 中,比如下面这块是自带的主题内联样式:

<style id="classic-theme-styles-inline-css">
/*! This file is auto-generated */
.wp-block-button__link{color:#fff;background-color:#32373c; ... ... ... ... }
/*# sourceURL=/wp-includes/css/classic-themes.min.css */
</style>

快速移除方法:

复制以下代码到主题的 functions.php 文件中的最后即可,

// 移除 classic-theme-styles-inline-css
add_action('wp_enqueue_scripts', function () {
    wp_dequeue_style('classic-theme-styles');
    wp_deregister_style('classic-theme-styles');
}, 100);

提示:如果不能立即生效,多半是你的缓存插件或CDN需要清除一下缓存后再试。

原文地址: https://themebetter.com/wordpress-remove-classic-theme-styles-inline-css.html

ArcticFox

人生短短几十年,不要给自己留下了什么遗憾,想笑就笑,想哭就哭,一件事,就算再美好,一旦没有结果,就不要再纠缠,久了你会倦,会累;一个人,就算再留念,如果你抓不住,就要适时放手,久了你会神伤,会心碎。

手机扫码阅读

微信或手机浏览器扫一扫,随时随地随心阅读与分享

comments.cmd 可写入
guest@kernelink:~/posts/160$ comment --compose
identity.env 访客信息
VERIFY / 人机校验
插入 访客会话 Text + UBB · UTF-8 · LF 0 字符