phpcms访问顶级栏目,自动跳到第一个子栏目

在顶级栏目的category页放入如下代码:

<?php
 if($child){
     $child_arrary=explode(',',$arrchildid);
        $to_url=$CATEGORYS[$child_arrary[0]][url];
  echo "<script>window.location.href='".$to_url."'</script>";
    }
?>

如果子栏目是文章模型,则需要有list页

posted @ 2014-10-09 10:22  savokiss  阅读(2030)  评论(0编辑  收藏  举报