关注迷你日志公众号

输出全部分类,并对当前分类current标记:

<ul id="nav_menu">
<?php $this->widget('Widget_Metas_Category_List')->to($category); ?>
<?php while ($category->next()): ?>
<li<?php if ($this->is('post')): ?><?php if ($this->category == $category->slug): ?> class="current"<?php endif; ?><?php else: ?><?php if ($this->is('category', $category->slug)): ?> class="current"<?php endif; ?><?php endif; ?>><a href="<?php $category->permalink(); ?>" title="<?php $category->name(); ?>"><?php $category->name(); ?></a></li>
<?php endwhile; ?>
</ul>
转载请注明出处,谢谢!
本文地址:https://minirizhi.com/jianzhan/36.html
THE END

话题: 分类, 当前分类, 高亮

  • Typecho自定义pagenav样式
  • Typecho自定义分类、搜索、首页文章数量