Counting Posts of a Given Post Type Having a Specific Taxonomy?

Somatic had the cleanest answer, but missed one thing. You should specify the numberposts to be -1 so that it counts them all. Like this: $args = array( ‘post_type’ => ‘artwork’, ‘post_status’ => ‘published’, ‘genre’ => ‘romantic’, ‘numberposts’ => -1 ); $num = count( get_posts( $args ) ); just replace genere with your taxonomy slug … Read more

Formating the_terms() function output

While you can specify separators and such in the_terms() arguments, it assumes that you actually want links. You can discard unwanted HTML by using filter: add_filter(‘the_terms’, ‘no_terms_links’, 10, 2); function no_terms_links($term_list, $taxonomy) { if (‘type’ == $taxonomy) return wp_filter_nohtml_kses($term_list); return $term_list; } Or just use deeper get_the_terms() function and iterate through its return to build … Read more

Remove Category description textarea

/*remove term descriptions from post editor */ function wpse_hide_cat_descr() { ?> <style type=”text/css”> .term-description-wrap { display: none; } </style> <?php } add_action( ‘admin_head-term.php’, ‘wpse_hide_cat_descr’ ); add_action( ‘admin_head-edit-tags.php’, ‘wpse_hide_cat_descr’ ); If you need to target it to category editor only – in other words leave description for other taxonomies, then easiest will be to position the … Read more