我有如下功能设置:
<?php $terms = get_terms("wpsc_product_category");
if ( !empty( $terms ) && !is_wp_error( $terms ) ){
foreach ( $terms as $term ) { ?>
<li class="calendar-filter-menu-item" data-filter=".<?php echo $term->slug; ?>"><?php echo $term->count; ?></li>
<?php }
} ?>
其中显示分类slug
和count
对于每个分类法,唯一的问题是它没有显示中没有帖子的分类法,只显示分配了帖子的分类法,是否也可以显示空的分类法?