<?php wp_list_categories( $args ); ?>
另一种方法,方便自定义样式,代码如下:
<div class="rightbox">
<div class=" cat_right_bg cat_title">分类目录</div>
<div style="margin-left:5px;">
<ul id="navigation">
<?php
$args8 = array(
'show_option_all' => '',
'orderby' => 'name',
'order' => 'ASC',
'show_last_update' => 0,
'style' => 'list',
'show_count' => 1,
'hide_empty' => 0,
'use_desc_for_title' => 1,
'hierarchical' => true,
'title_li' => '',
'number' => NULL,
'echo' => 1,
'depth' => 0,
'current_category' => 0,
'pad_counts' => 0,
'taxonomy' => 'category',
);
wp_list_categories( $args8 );
?>
</ul>
</div>
</div>
将以上代码,添加到模板的sidebar.php中适合的位置。