'ids', //we don't really need all post data so just id wil do fine. 'posts_per_page' => -1, //-1 to get all post 'post_type' => $type, 'tax_query' => array( array( 'taxonomy' => $taxonomy, 'field' => 'slug', 'terms' => $term ) ) ); $ps = get_posts( $args ); if (count($ps) > 0){return count($ps);}else{return 0;} } //call it from the template like this, make sure to change the post type variable $ptypes = array('projects'); //array with all of your post types $tags = get_tags( array('order' => 'ASC') ); foreach ( (array) $tags as $tag ) { ?>
  • name ?>