将代码添加到分类归档模板文件主循环的上面:
<?php
if ( is_category() ) {
$this_category = get_category( $cat );
}
?>
<?php
if ( $this_category->category_parent )
$this_category = wp_list_categories( 'orderby=id&show_count=0&title_li=&use_desc_for_title=1&child_of='.$this_category->category_parent."&echo=0" );
else
$this_category = wp_list_categories( 'orderby=id&depth=1&show_count=0&title_li=&use_desc_for_title=1&child_of='.$this_category->cat_ID."&echo=0" );
if ( $this_category ) { ?>
<ul>
<?php echo $this_category; ?>
</ul>
<?php } ?>
声明:购买之前认真了解您所购买的何种资源,该资源并不包括许可证、升级、扩展、安装等。汉化等相关文件为本站所有,相关资源均有原链接,如需商用请购买原版代码,本站所有的代码均为本地测试所用。