count terms function, output is missing a taxonomy
-
Hi all,
I am creating a filterable portfolio. I’m using
wp_count_terms
to count the number of terms (taxonomies) in my cptspecialty
. The output is 2 out of the 3 terms. There IS a post under the 3rd missing taxonomy, so that shouldn’t be the issue. Could anyone help me figure out why I’m missing a taxonomy?<?php $terms = get_terms("specialty"); //taxonomy of cpt $count = wp_count_terms($terms); echo '<ul id="portfolio-filter">'; echo '<li><a href="" rel="all" title="" class="filter">All</a></li>'; if ( $count > 0 ){ foreach ( $terms as $term ) { $termname = strtolower($term->name); $termname = str_replace(' ', '-', $termname); echo '<li><a href="" class="filter" title="" rel="'.$termname.'">'.$term->name.'</a></li>'; } } echo "</ul>"; ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘count terms function, output is missing a taxonomy’ is closed to new replies.