Typecho将分类添加到导航菜单中
Typecho默认是将单页面链接显示在导航菜单中,如何将分类添加到导航菜单中?将以下代码加在header.php即可:
<?php $this->widget('Widget_Metas_Category_List')->to($category); ?> <?php while($category->next()): ?> <li<?php if($this->is('category', $category->slug)): ?> class="current"<?php endif; ?>><a href="<?php $category->permalink(); ?>"><?php $category->name(); ?></a></li> <?php endwhile; ?>
本文标题:《Typecho将分类添加到导航菜单中》
本文链接:https://zhangwenbao.com/typecho-add-category-to-navigation-menu.html
您好,使用这个代码在header.php中,有二级分类,结果一级二级分类都出来了,并且错位了,怎么解决呢?