Typecho文章页内获取当前父分类的所有子分类
https://www.douban.com/note/582907962/
https://www.qiansw.com/typecho-article-page-to-get-all-the-sub-classification-of-the-current-parent.html
<ul>
<?php $this->widget('Widget_Metas_Category_List')->to($categorys); ?>
<?php while ($categorys->next()): ?>
<?php
if ($this->category == $categorys->slug&&($this->is("post")||$this->is("category"))){
$childrens = $this->widget('Widget_Metas_Category_List')->getAllChildren($categorys->parent);
for ($i=0; $i <count($childrens) ; $i++) {
$thisChild = $this->widget('Widget_Metas_Category_List')->getCategory($childrens[$i]);
?>
<li><a href="<?php echo $thisChild["permalink"] ?>"><?php echo $thisChild["name"] ?></a></li>
<?php
}
}
?>
<?php endwhile;?>
</ul>
最后修订于 2017-11-24 23:07:23