1、修改function.php
在function.php文件里新增如下代码,文件路径:usr/themes/Joe
// 全站置灰
$websiteChgGray = new Typecho_Widget_Helper_Form_Element_Select(
'websiteChgGray',
array(
'off' => '关闭(默认)',
'on' => '开启',
),
'on',
'是否启用全站置灰',
'介绍:开启后,网站所有信息全部变成黑白'
);
$websiteChgGray->setAttribute('class', 'joe_content joe_custom'); // 如果无法显示设置,将joe_custom修改为joe_other
$form->addInput($websiteChgGray->multiMode());
2、修改include.php
在include.php文件的底部增加,文件路径:usr/themes/Joe/public
<?php if ($this->options->websiteChgGray === 'on') : ?>
<style>html { filter: grayscale(1); }</style>
<?php endif; ?>
© 版权声明
THE END
暂无评论内容