Get user’s most published categories
This can be done easily with $wpdb, here’s my approach: function GetTop2CategoryByUser($user_id, $taxonomy){ global $wpdb; $results=$wpdb->get_results( $wpdb->prepare( ” SELECT tt.term_id as category, COUNT(p.ID) as count FROM $wpdb->posts p JOIN $wpdb->term_relationships tr ON p.ID = tr.object_id JOIN $wpdb->term_taxonomy tt ON tt.term_taxonomy_id = tr.term_taxonomy_id AND (tt.taxonomy = %s AND tt.term_taxonomy_id != 1) WHERE p.post_author = %s GROUP … Read more