类别列表(不包括任何子类别)可以通过以下代码显示。不要害怕大量的论点,它们不是强制性的。
<?php $args = array(
\'show_option_all\' => \'\',
\'show_option_none\' => \'\',
\'orderby\' => \'ID\',
\'order\' => \'ASC\',
\'show_count\' => 0,
\'hide_empty\' => 0,
\'child_of\' => 0,
\'exclude\' => \'0\',
\'echo\' => 1,
\'selected\' => 0,
\'hierarchical\' => 1,
\'name\' => \'category\',
\'id\' => \'\',
\'class\' => \'postform\',
\'depth\' => 1,
\'tab_index\' => 0,
\'taxonomy\' => \'category\',
\'title_li\' => __( \'\' ),
\'hide_if_empty\' => false
); ?>
<ul class="top-level">
<?php wp_list_categories( $args ); ?>
</ul>
父子类别查看由控制
\'depth\' => 1,
.
法典:wp_list_categories()
.