首页 » 收集 » 正文内容
typecho 获取某个分类下面的子级分类
寻梦xunm| 259| 收集
10个月前
超过315天 温馨提示
本文最后更新于2023年11月10日,已超过315天没有更新,若内容或图片失效,请留言反馈。

typecho 获取某个分类下面的子级分类的具体代码如下,其中这段代码“$categorys->getAllChildren('11');”中数字“11”就是要查询分类的mid,使用的时候自行修改为对应的分类mid。

<?php 
  $this->widget('Widget_Metas_Category_List')->to($categorys); 
  $children = $categorys->getAllChildren('11');
  if (!empty($children)) { 
     foreach ($children as $mid) { 
        $child = $categorys->getCategory($mid); 
?>
        <a href="<?php echo $child['permalink'] ?>" class="cmsgoto"><?php echo $child['name']; ?></a>
<?php }} ?>

0 赞 or 打赏
喜欢就打赏一点
微信 支付宝
隐私
Q Q:1340326824
邮箱:vipshiyi@qq.com
QQ群:422720328

我的音乐

微博客-专为自己编写开发的源码