我自己搜索了很久,终于找到了答案here:
综上所述,在每个类别的末尾添加“>”的代码是:
<?php
$taxonomy = \'category taxonomy\';
$orderby = \'name\';
$show_count = 1; // 1 for yes, 0 for no
$pad_counts = 0; // 1 for yes, 0 for no
$hierarchical = 1; // 1 for yes, 0 for no
$title = \'\';
$empty = 0;
$args = array(
\'taxonomy\' => $taxonomy,
\'orderby\' => $orderby,
\'show_count\' => $show_count,
\'pad_counts\' => $pad_counts,
\'hierarchical\' => $hierarchical,
\'title_li\' => $title,
\'hide_empty\' => $empty
);
?>
<ul>
<?php
$variable = wp_list_categories($args);
$variable = str_replace(\'</a>\', \' ></a>\', $variable);
echo $variable;
?>
</ul>
希望这有帮助。键是$empty参数。