TYPECHO WIKI

Typecho 输出全部分类并且给当前分类Class

发布者:Typecho维基君/更新日期:2018-05-17/人气指数:1111

Typecho输出全部分类,并且并对当前分类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>
本文检索关键词:typecho
赞助支持

添加新评论 »