list custom taxonomy with count

<?php $taxonomy = ‘judges’; $tax_terms = get_terms($taxonomy); ?> <ul> <?php foreach ($tax_terms as $tax_term) { echo ‘<li>’ . ‘<a href=”‘ . esc_attr(get_term_link($tax_term, $taxonomy)) . ‘” title=”‘ . sprintf( __( “View all shows for %s” ), $tax_term->name ) . ‘” ‘ . ‘>’ . $tax_term->name . ‘(‘ . $tax_term->count . ‘)</a> </li>’; } ?> </ul> Try … Read more

How can I get 3 different taxonomy type terms in a div class element?

If using get_the_terms, you can just do your if loop once for each taxonomy and then join them after the three loops. Of course, it would probably be more efficient to use: wp_get_post_terms( $post_id, $taxonomy, $args ); You could then do something like: wp_get_post_terms( $post_id, array( ‘resource_roles’, ‘resource_media’, ‘resource_theme’ ) ); Which would pull all … Read more

List all Custom Post Type posts excluding certain Taxnomy term

Sounds like you’re looking for the NOT IN value of the operator argument of a tax_query. Depending on your situation, you should use either WP_Query or pre_get_posts. Your tax_query would then look something like this: ‘tax_query’ => array( array( ‘taxonomy’ => ‘{your taxonomy slug}’, ‘field’ => ‘slug’, ‘terms’ => ‘featured’, ‘operator’ => ‘NOT IN’ ) … Read more

Multiple archives to display parent and subcategories content

With the below, you are grabbing terms from the event_category taxonomy Note that you are always grabbing the same terms though. $terms = get_terms( ‘event_category’, array( ‘orderby’ => ‘count’, ‘hide_empty’ => true ) ); If you want to grab only from the current pages children, then you should grab the current term and set your … Read more

Double slash in the_terms URL

First Assumption: That an extra slash was being added for some reason To see what was going on, I wanted to see what was going on in the array. When I print_r() the array I get the following: Array ( [10] => stdClass Object ( [term_id] => 10 [name] => Mozilla [slug] => mozilla [term_group] … Read more