I want to display the posts count of each author, but posts that are in some categories should be excluded from the count.
I tried doing this with count_user_posts( $user->ID )
, but this function doesn't have any category excluding options. My second approach was to do this by querying the posts table with mySQL's COUNT
function, but the category IDs are not stored in that table, so I can´t exclude categories this way.
Now, before I do some weird and less performant JOIN
querys, I hope someone can show me a better way how to do this.