【子比小功能】页面增加刷新悬浮按钮

【子比小功能】页面增加刷新悬浮按钮

效果

d2b5ca33bd154746

教程

位置-1

inc/options/admin-options.php

array(
                        'title'        => '更多按钮',
                        'subtitle'     => '添加更多自定义按钮',
                        'id'           => 'more',
                        'type'         => 'group',
                        'button_title' => '添加按钮',

在此代码上方添加一下代码

array(
                        'title'      => '刷新页面',
                        'id'         => 'refresh_page',
                        'type'       => 'accordion',
                        'accordions' => array(
                            array(
                                'title'  => '刷新页面',
                                'fields' => array(
                                    CFS_Module::float_btn()[0],
                                    CFS_Module::float_btn()[1],
                                    CFS_Module::float_btn()[2],
                                ),
                            ),
                        ),
                    ),

位置-2

/inc/functions/zib-footer.php

$btn .= '<' . $tag . $style . ' class="' . $class . '"' . $target . $title . ' href="' . $href . '">' . $icon . $hover . '</' . $tag . '>';
                    }
                }
                break;

此代码下方增加

case 'refresh_page':
                $btn .= '<a ' . $style . ' class="float-btn" data-placement="left" title="刷新当前页面"' . $tooltip . ' onclick="javascript:location.reload();"><i class="fa fa-refresh"></i></a>';
                break;

后台

进入主题的悬浮按钮设置,点击刷新页面,开启pc移动端显示,设置图标颜色,移动位置,最后调整一下位置即可。

d2b5ca33bd155226

注意

该功能会因为主题更新导致失效,需要重新添加代码,并重新设置。

© 版权声明
THE END
喜欢就支持一下吧
点赞13 分享
评论 抢沙发

请登录后发表评论

    请登录后查看评论内容