加入测心网,获得更多

无论您想服务网友,还是想获取帮助(如批量调查或测试),可以微信/QQ:57762787

WordPress移动端网站纯代码添加底部导航菜单

把下面代码放到你主题style.css文件的最后面(主题自定义中,额外css中添加也可以)

.mobile-bar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background: #FFF;
z-index: 9;
border-top: 0px solid #e0e0e0;
width: 100%;
display: table;
box-shadow: 0 0 50px 0 #748594;
}
.mobile-bar a {
cursor: pointer;
color: #5D656B;
display: table-cell;
text-align: center;
text-decoration: none;
}
.mobile-bar a i {
margin-top: -2px;
text-align: center;
vertical-align: middle;
background-repeat: no-repeat;
background-size: 100%;
display: inline-block;
width: 38px;
height: 38px;
}
.mobile-bar a span {
display: block;
color: #333;
margin-top: -6px;
font-size: 14px;
}
a.i-home i {
background-image: url(https://www.xinlixue.cn/**/ico/home.png);
}
a.i-cat i {
background-image: url(https://www.xinlixue.cn/**/ico/ask.png);
}
a.i-my i {
background-image: url(https://www.xinlixue.cn/**/ico/test.png);
}
a.i-buy i {
background-image: url(https://www.xinlixue.cn/**/ico/more.png);
}
a.i-cat.burger-menu {
position: initial !important;
line-height: inherit;
width: initial;
height: inherit;
font-family: inherit;
}

把下面代码放到你主题 footer.php文件的标签前

<?php
if(wp_is_mobile()&&!is_single()){?>
<div class="mobile-bar">
<a class="i-home" href="/"><i></i><span>首页</span></a>
<a class="i-cat burger-menu" href="/"><i></i><span>问答</span></a>
<a class="i-my" href="/"><i></i><span>测试</span></a>
<a class="i-buy" href="/"><i></i><span>留言</span></a>
</div>
<?php }?>

打赏作者,期待美好

打赏鼓励作者,为网友提供更多更好的测试,也许一瓶水就够了。

赞 (3) 打赏

评论

6+5=

打赏作者,期待更多

微信扫一扫打赏