Joe主题PC端有登录注册功能,而移动端没有登录功能,所以就自己加了一个。
1,2为演示图
添加教程:
1. 打开Joe主题根目录,找到public目录下的header.php文件并打开
2. 滑动到文件下方,在倒数第二个div盒子内后放添加如下代码(</ul>标签和</div>标签之间),如图3
```PHP
<!--自定义登录区域-->
<ul class="joe_header__slideout-menu">
<?php if ($this->user->hasLogin()) : ?>
<div class="logout">
<a class="link" href="<?php $this->options->logoutUrl(); ?>">退出</ a>
</div>
<?php else : ?>
<div class="log-button">
<a class="link" href="<?php $this->options->adminUrl('login.php'); ?>" title="登录">
<span>登录</span>
</ a>
</div>
<div class="reg-button">
<a class="link" href="<?php $this->options->adminUrl('register.php'); ?>" title="注册">
<span>注册</span>
</ a>
</div>
<?php endif; ?>
</ul>
```
3. 在Joe主题根目录下找到assets文件夹中CSS文件夹下的joe.global.min.css文件并打开
4. 在顶部添加如下CSS样式代码,如图4
.logout {margin: 10px 0;width: 100%;}.logout .link {display: inline-block;margin: 0 30%;padding: 0 !important;width: 40%;height: 32px;line-height: 32px;background-color: #ff3535;border-radius: 10px;color: #fff;text-align: center;}.log-button, .reg-button {display: inline-block;width: 49%;}.log-button .link, .reg-button .link {margin: 10px auto;width: 60%;height: 32px;background-color: #138eef;border-radius: 10px;color: #fff;}.reg-button .link {background-color: #fd7315;}.log-button .link span, .reg-button .link span {display: inline-block;width: 100%;text-align: center;}
2. 分享目的仅供大家学习和交流,您必须在下载后24小时内删除!
3. 不得使用于非法商业用途,不得违反国家法律。否则后果自负!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
5. 如有链接无法下载、失效或广告,请联系管理员处理!
6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
7. 如有侵权麻烦联系邮箱2697381891@qq.com删除文章!
源码库 » Joe主题移动端添加登录注册功能