Display empty taxonomy terms with get_terms()

Question

I have a function setup as follows:

<?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 }
 } ?>   

Which displays the taxonomy slug and count for each taxonomy, only problem is it’s not showing a taxonomy that has no posts in, only taxonomies with posts assigned to them are being show, is it possible to show empty taxonomies as well?

0
, , , user1374796 8 years 2014-09-11T06:14:47-05:00 0 Answers 107 views 0

Leave an answer

Browse
Browse