List total number of users that are authors

count_users() should give you an array of all the required user counts. You can use it like this. $user_counts = count_users(); $authors = $user_counts[‘avail_roles’][‘author’]; //Get the author count $subscribers = $user_counts[‘avail_roles’][‘subscriber’]; //Get the subscriber count echo $authors. ‘ Authors so far’; echo $subscribers. ‘ Subscribers so far’;

Pagination Help on Crazy Custom Authors Page

I doubt you’re going to be able to repurpose WP-PageNavi for this, since you’re not using the built-in queries at all. You should be able to roll pagination yourself, though, and still fall back on some of WordPress’s built-in functionality. In particular, if your URL matches the pattern /meet-the-team/page/3/, the paged querystring variable will automatically … Read more

Get all authors with at least one post of ‘custom post type’

For now post_type support is not currently available for count_user_posts(), so put the below code in theme’s functions.php file. function count_user_posts_by_type( $userid, $post_type=”post” ) { global $wpdb; $where = get_posts_by_author_sql( $post_type, true, $userid ); $count = $wpdb->get_var( “SELECT COUNT(*) FROM $wpdb->posts $where” ); return apply_filters( ‘get_usernumposts’, $count, $userid ); } Now this function would take … Read more