This commit is contained in:
haoouba 2021-01-19 19:37:16 +08:00
parent 0e1e747838
commit f81e6bbca4

View File

@ -8,16 +8,18 @@
</a>
<nav class="joe_header__above-nav">
<a class="item <?php echo $this->is('index') ? 'active' : '' ?>" href="<?php $this->options->siteUrl(); ?>">首页</a>
<?php $this->widget('Widget_Contents_Page_List')->to($pages); ?>
<!-- 判断是否超出设置的个数,未超出全部直接显示 -->
<?php if (count($pages->stack) <= $this->options->JNavMaxNum) : ?>
<?php foreach ($pages->stack as $item) : ?>
<a class="item" href="">首页</a>
<?php endforeach; ?>
<?php else : ?>
<?php foreach (array_slice($pages->stack, $this->options->JNavMaxNum) as $item) : ?>
<a class="item <?php echo $this->is('page', $item['slug']) ? 'active' : '' ?>" href="<?php echo $item['permalink'] ?>"><?php echo $item['title'] ?></a>
<?php endforeach; ?>
<div class="joe_dropdown">
</div>
<?php endif; ?>
</nav>
<form class="joe_header__above-search" method="post" action="<?php $this->options->siteUrl(); ?>">