功能介绍
感觉每次进入自己站点都对鼠标指针不满意,想换成二次元图片?炫酷图标?或者自定义成自己喜欢的模样,那就试试集成以下这个功能吧!
配置教程
首先利用宝塔或则FTP打开/inc/options下的admin-options.php文件把下面代码放在20行左右
- array(
- ‘id’ => ‘is_diy_mouse’,
- ‘type’ => ‘switcher’,
- ‘title’ => ‘鼠标指针美化’,
- ‘label’ => ‘启用后可自定义鼠标样式’,
- ‘default’ => false,
- ),
- array(
- “id” => “body_mouse_img”,
- “type” => “upload”,
- “title” => “普通指针图片”,
- ‘placeholder’ => ‘http://’,
- ‘button_title’ => ‘上传’,
- ‘remove_title’ => ‘删除’,
- “dependency” =>
- array(“is_diy_mouse”, “==”, ‘true’,)
- ),
- array(
- “id” => “hover_mouse_img”,
- “type” => “upload”,
- “title” => “链接指针图片”,
- ‘placeholder’ => ‘http://’,
- ‘button_title’ => ‘上传’,
- ‘remove_title’ => ‘删除’,
- “dependency” =>
- array(“is_diy_mouse”, “==”, ‘true’,)
- ),
最后在主题根目录下打开functions.php将以下代码放在最后即可
- //+———————————————————————-
- //| 鼠标指针美化
- //+———————————————————————-
- if (_cao(‘is_diy_mouse’)){
- add_action(‘wp_footer’, function () {
- $body_mouse_img=_cao(‘body_mouse_img’);
- $hover_mouse_img=_cao(‘hover_mouse_img’);
- echo <<<EOT
- <style>
- body {cursor: url($body_mouse_img), default;}
- a:hover{cursor:url($hover_mouse_img), pointer;}
- </style>
- EOT;
- }, 100);
- }
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。