List the number of posts for each custom taxonomy and specific custom field value

The solution is: global $wpdb; $terms = get_terms(“TAXONOMY_TERM”); $count = count($terms); if ( $count > 0 ){ foreach ( $terms as $term ) { $querystr = ” SELECT count(ID) as count FROM $wpdb->posts LEFT JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) LEFT JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) WHERE exists ( SELECT * FROM $wpdb->postmeta WHERE … Read more

Outputting an array of term meta values in a custom WooCommerce tab?

For your author content display, instead of print_r($all_term_meta); try a foreach: foreach($all_term_meta as $meta) { return $meta[0]; } It’s possible you may need to use “echo” instead of “return” but try “return” first. To control whether or not there is an author tab, update your woo_new_product_tab function with the same condition: function woo_new_product_tab( $tabs ) … Read more