This reply was pretty low on the list, on the article you referred to; but it will do the job:
$users_count = count(get_users(array('fields'=>array('ID'),'role'=>'author')));
Related Posts:
- Set Alias for meta_query arguments in get_posts()
- How can I use order_by to order by two meta_keys without excluding posts that don’t have those keys initialized?
- Loop within a loop?
- WP_Comment_Query pagination, delving into the unknown
- Sort posts by category name and title
- Getting all user metadata from user
- How to get posts in different language from WPML Plugin [closed]
- Limit WP_Query to only X results (total, not per page)
- WP_Query meta_query where meta value ends in space
- How to disable main query?
- wp_query for the first sticky, then display the rest of the posts excluding the first sticky
- Use post__in and post__not_in together?
- how to retrieve specific product attribute value in an sql query?
- How to user WP_Query to lower the number of queries
- Compile two queries to one set of results?
- how do i combine keyword search and taxonomy in a WP_query $args array Worpresss [closed]
- query attachments of parent page if attachments of current page are smaller than …
- WP_Query tax_query problem
- Only display authors who have posts
- Update Loop with Form
- How to retrieve current page WP_Query arguments?
- How can I get an array of all IDs from the current queried object?
- Query Custom Post Type Order By Taxonomy Field
- Setting get_queried_object
- Changing WP_Query params with url Query Var
- From where is archive.php getting its posts?
- Wp redirect to url with ampersand string
- Get attachment by meta_key value
- Complex WP_Query order request: DESC by day, but then ASC by time
- How can I make WP_Query get posts that have a tag but also have random other tags?
- Change query based on post type while staying in loop
- Access WordPress query by index number outside the loop
- Custom Pagination Layout for Elementor widget
- Pagination outside of loop
- Multisite – Global CPT – advices?
- $WP_Query: How to display excerpt on first post only
- How to properly reset a nested WP_Query query
- Gallery shortcode numerical sorting
- Is there a reason why Pages are not publicly_queryable?
- Check return value of get_posts
- How Can I Change The Tax Query For The Main Loop For Taxonomy Archives?
- The most effective way to split by post type in custom query?
- Get a list of posts by specific category
- WordPress Query String: get_posts(‘cat=5’) vs WP_Query( ‘cat=5’) vs URL: /site/?cat=5
- apply custom where to the default $wp_query
- WP_Query – Adding “offset” posts to the end of the loop
- wp_query is showing posts from other categories
- Multiple wordpress queries with nested output (odd – even)
- it’s possible make a WP_Query with math operations?
- show posts with range meta key
- how to write wordpress query for multiple metakeys checking?
- Sorting search results with custom dropdown
- Using a Shortcode to List Posts from Multiple Categories
- How to display a list of posts in same child category as current post
- querying posts with a custom status
- wp_query on page template not working (Genesis framework)
- Display post meta conditionally based on it’s value
- How can i show pagenavi in my author.php?
- Randomly select one of last 3 posts
- Query multiple meta key values for template
- Using WP_Query with multiple loops on one page in search.php
- Order by post meta not working with pre_get_posts filter
- Searching not only by post name but also category
- ACF: How to query for a given value count of an array like field? (e.g.: How many rows has a `flexible_content` field?)
- is_user_logged_in not working from WP-API (wp-json)
- WordPress private post won’t display to other admins
- Only show tag with the same id as the post
- Search Exact on WordPress – Relevannsi Solution Not Working
- ACF: How can I publish values of ACF fields in a loop while using wp_query?
- Sort by price wpdb
- WP_Query random ordering not working since 5.4
- Show a message if there are no active posts in category
- Get authors list and sort them by recent posts
- Where my home page and font options has gone?
- How to get the latest post list (of the parent custom custom type)
- Problem with my loops
- 404 page on custom search pagination
- next_posts_link not visible on first page
- Query string order by custom field
- Paging works correctly on local version, but not live?
- Create global array to compare inside a query
- Pagination not working in custom loop WP_Query
- Multiple wpostmeta.meta_key
- Hi , i am trying to set the post for 24 hours and with it will be changed
- Own query vars are not displayed
- Show full category tree for a year with all post titles?
- Trying to use “Medium” featured image for custom post type on home page
- Modify query to exclude certain ids and certain parents and its corresponding children
- Filter posts/pages by user_role array
- Display images with same specific value?
- WP_Query with meta_value_num and meta_query not paged correctly
- I need value of saved meta to display next to the post it is associated with
- Post Query not working after updating to 4.1
- Search Query that Includes Custom Table
- Pagination with WP_Query not working
- new WP_Query based on average values of meta fields
- How return normal search result using wp_ajax action for wordpress
- Custom post types loop on a page template
- Can’t seem to get an else statement correct? [closed]
- query_vars category_name only display one catgory out of multiple categories