typecho如何取出分类列表?
本文介绍了typecho如何取出分类列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
我想在主页header
里面显示分类列表,替换掉那三个(分类、标签、归档
)独立页面,并保留关于
页面;请问如何实现?
下面这段是我header文件里遍历出独立页面的代码,该如何修改?
<?php $this->widget('Widget_Contents_Page_List')->to($pages); ?>
<?php while($pages->next()): ?>
<li class="menu-item menu-item-home">
<a href="<?php $pages->permalink(); ?>" rel="section"><?php $pages->title(); ?></a>
</li>
<?php endwhile; ?>
解决方案
<?php $this->widget('Widget_Metas_Category_List')->to($categories); ?>
<?php while($categories->next()): ?>
<li class="menu-item menu-item-home">
<a href="<?php $categories->permalink(); ?>" rel="section"><?php $categories->name(); ?></a>
</li>
<?php endwhile; ?>
<?php $this->widget('Widget_Contents_Page_List')->to($pages); ?>
<?php while($pages->next()):if($pages->title == '关于'): ?>
<li class="menu-item menu-item-home">
<a href="<?php $pages->permalink(); ?>" rel="section"><?php $pages->title(); ?></a>
</li>
<?php endif;endwhile; ?>
这篇关于typecho如何取出分类列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文