I want to display total number of user who only have posts at WordPress. I can get all users by this query
<?php $user_count = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->users;"); echo $user_count ?>
But for the user count only with posts, i think i might need to join another table, does anyone have snippets ? Thanks.
I don’t use wordpress, but if the schema at http://codex.wordpress.org/images/8/83/WP_27_dbsERD.png is close to the version that you are using, then you should be able to do something like
If you wanted to know which users had what number of posts you could do