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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)