一为(onenav)主题导航 – 导航条弹出 最近访问 记录源码添加教程

网络技术3个月前更新 AI管家
473 00
广告也精彩

一为(onenav)主题导航 – 导航条弹出 最近访问 记录源码添加教程

一为(onenav)主题导航 – 导航条弹出 最近访问 记录源码添加教程

 

效果演示站:https://www.weixii.com/

1.添加代码文件 wp-content/themes/onenav/inc/functions/io-header.php

放在 用户按钮 前面

一为(onenav)主题导航 – 导航条弹出 最近访问 记录源码添加教程
// 最近访问按钮
echo‘<li class=”header-icon-btn” style=”background:none;border:none;box-shadow:none;cursor:pointer;”>
<a href=”javascript:;” onclick=”toggleEyePop()”
style=”font-size:20px;color:#26b99a;text-decoration:none;display:inline-block;
transition:all 0.3s ease;animation:eyeBreath 3s infinite ease-in-out;line-height:1;”
onmouseover=”this.style.transform=\’scale(1.2)\'”
onmouseout=”this.style.transform=\’scale(1)\'”
onmousedown=”this.style.transform=\’scale(0.92)\'”
onmouseup=”this.style.transform=\’scale(1.2)\’;”>
<svg width=”20″ height=”20″ viewBox=”0 0 24 24″ fill=”none” stroke=”#26b99a” stroke-width=”2″ stroke-linecap=”round” stroke-linejoin=”round”>
<circle cx=”12″ cy=”12″ r=”10″ stroke-dasharray=”1 2″ />
<polyline points=”12 6 12 12 16 14″></polyline>
</svg>
</a>
</li>’;

2.放在io-header.php 文件最后面 另外记的把里面的域名 www.sbrdh.com 搜索换成你自己的

// 最近访问弹框代码

add_action(‘wp_footer’, ‘io_visit_history_html’);
functionio_visit_history_html(){
if(is_admin())return;
?>

<style>@keyframes eyeBreath{0%{opacity:.75}50%{opacity:1}100%{opacity:.75}}.drag-eye-wrap{position:fixed;right:15px;top:55px;z-index:999999;user-select:none}.eye-pop{position:absolute;right:0;top:0;width:300px;background:#fff;border-radius:10px;box-shadow:0 2px 12px rgba(0,0,0,.12);display:none;overflow:hidden;border:1px solid #e8e8e8}.eye-hd{display:flex;justify-content:space-between;align-items:center;padding:10px 14px;border-bottom:1px solid #f2f2f2}.eye-hd h5{margin:0;font-size:14px;font-weight:500;color:#333}.eye-close{border:none;background:none;font-size:18px;cursor:pointer;color:#999;padding:0;line-height:1}.eye-list{margin:0;padding:0;list-style:none;max-height:280px;overflow:auto}.eye-item{display:flex;align-items:center;padding:8px 12px;border-bottom:1px solid #f7f7f7;gap:8px}.eye-ico{width:28px;height:28px;border-radius:50%;flex-shrink:0;overflow:hidden;background:#f5f5f5}.eye-name{flex:1;font-size:13px;color:#333;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.eye-

隐藏内容!
付费阅读后才能查看!
¥10
¥19
多个隐藏块只需支付一次

 

© 版权声明
明晰AI

相关文章

广告也精彩

暂无评论

none
暂无评论...