* @license MIT License */ if (!defined('ABSPATH')) { exit; } /** * 把灰度反转掉 * * 为什么写两遍: * - `html{filter:none}` 取消外面的灰度; * - 但某些浏览器在 filter 从有到无的瞬间会留下合成层缓存,导致首屏仍是灰的, * 所以补一条 `filter:grayscale(0%)` 显式声明,比 none 更稳。 * * 权限用 `!important`:主题的灰度样式在 wp_head 优先级 1 输出, * 本段在优先级 2,同优先级下后写的赢,加 !important 是防其它插件插入的覆盖。 */ function yang_mourning_page_ungrayscale() { echo '\n"; } add_action('wp_head', 'yang_mourning_page_ungrayscale', 2); /** * 输出本页样式 */ function yang_mourning_page_print_css() { echo '\n"; } add_action('wp_head', 'yang_mourning_page_print_css', 3); get_header(); ?>