<?php
$args = array(
\'show_option_all\' => \'\',
\'orderby\' => \'name\',
\'order\' => \'ASC\',
\'style\' => \'list\',
\'show_count\' => 1, // 1 is true and 0 is false
\'hide_empty\' => 1,
\'use_desc_for_title\' => 1,
\'child_of\' => 0,
\'feed\' => \'\',
\'feed_type\' => \'\',
\'feed_image\' => \'\',
\'exclude\' => \'\',
\'exclude_tree\' => \'\',
\'include\' => \'\',
\'hierarchical\' => 1,
\'title_li\' => __( \'Categories\' ),
\'show_option_none\' => __(\'No categories\'),
\'number\' => null,
\'echo\' => 1,
\'depth\' => 0,
\'current_category\' => 0,
\'pad_counts\' => 0,
\'taxonomy\' => \'category\',
\'walker\' => null
);
wp_list_categories( $args );
?>
将代码放在要显示的任何位置,如果不想显示post count,请保留
\'show_count\' => 0
.
对于CSS li设计,只需使用酷图标亲自尝试即可。希望这对你有帮助。
您可以在此处了解有关类别的更多信息:http://codex.wordpress.org/Template_Tags/wp_list_categorieshttp://codex.wordpress.org/Template_Tags/wp_dropdown_categories