get author ids instead of author nicename to get posts for muliiple authors using WP_Query();
$author_list = array();
foreach((array)$authors_list as $author) $author_list[] = $author->ID;
// make comma separated string from author ids array
$author_list = implode(',', $author_list)
and change wp query args
$author_posts_args = array(
'author' => $author_list,
'post_type' => 'post',
'cat' => $colecti_id,
'posts_per_page' => '4',
);
$author_posts_query = new WP_Query($author_posts_args);
Related Posts:
- Getting all user metadata from user
- How to add custom query filters in WP_User_Query
- Filter user list that meta_value is empty
- Query wp_usermeta alongside wp_users
- SQL User Query by Multiple Roles using PHP
- WP User Query get all authors with last name starting with specific letter
- Sort users by “birthday” using WP_User_Query
- Hide Administrators From User List except current user (administrator)
- How to display user order by role
- Import wp users via one click demo option
- Dynamic User Id
- Prevent author bio page from showing in search results
- Get multiple users with meta value in one query and populate WP_User class
- Reduce number of SQL queries inside WP_Query loop to fetch author data
- Display if author page is author page of current user
- Get user first name from custom endpoint
- Storing an array of objects related to each user
- Create one-use post dynamically, add to main query, do not insert post (user profile view)
- Query pages created by deleted users
- Query posts by post type, author and post meta
- Random users always showing same 8 users
- Set “editor” role to existing user
- How to query 5 users in random who have published more than 10 posts
- How to query users by post count no less than 10
- Merge wp-query and get_users
- Get all wp_users sort by metakey
- Logging search queries for logged-in users
- List users by Year of Birth using a foreach loop to dynamically populate years and data
- Show subscriber id in loop
- Query Users by post count, last 30 days and display each users post count according to post type
- Get users query makes the site loading time too big?
- Get all user with both meta_value
- Group users by meta field, with name of meta field as group title
- 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?
- Exclude some authors from query
- 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 serialised array
- Conditional operator OR not working with custom fields
- How to add custom meta to ‘pre_get_terms’?
- Multiple wordpress queries with nested output (odd – even)
- Using Transients
- Should I reset $wp_query?
- show posts with range meta key
- how to write wordpress query for multiple metakeys checking?
- Sorting search results with custom dropdown
- Posts query according to meta box date
- 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
- problem with loop
- 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
- How can I change the term “Published” next to # of posts published on WordPress dashboard All Posts page?
- WP Query orderby ACF boolean values and ACF field value
- meta_query weird behaviour, static int will work, but not user data
- How to make the WP query search for the “s” arg in other places too
- WP_Query for a taxonomy value OR a custom post type meta field
- WP_query pagination on frontpage
- WP Query by 4 different taxonomies
- WordPress Query by Category using Post Slug
- Select multiple categories with is_tax
- WP Query for all events prior to current date
- Display Search Results by tag_ID in my search.php
- Repeat array inside array through while loop
- What’s causing an infinite loop?
- Displaying posts from sub taxonomies only
- pages shortcode filtering by category
- get term objects and post objects in query
- Ignoring ‘a’ when sorting posts
- Issue generating custom filter for cpt admin columns
- Duplicate a Query Built with PHP and Mysql but now in WordPress
- How to take parameters from a function and make them editable as attributes in a shortcode
- Object of class WP_Query could not be converted to int inside shortcode
- display post multiple times based on array of dates
- What method does this eventually call: do_action_ref_array( ‘parse_query’, array( &$this ) );
- WP_Query secondary query failing
- pre_get_posts or $where, which one to use?
- Sorting is not working in WordPress WP_Query
- Add custom WP_Query after the first 3 posts
- Some images not being returned with wp_get_attachment_image
- Weird results using wp-query with ‘date_query’ for last week
- How to count post meta key values for all posts in database
- Why won’t my paged wp_query work? [duplicate]
- Query for page content, and query for posts on the same page?
- Limit the number of posts via wpquery
- WP query with multiple custom meta not respecting orderby
- 1500+ duplicate queries via get_option function (query monitor)
- WordPress Ajax search filter on dropdown select
- after refresh the id that shows correct in first time click, changes to 1
- Adding a language rule and displaying posts with a custom taxonomy term on its archive page
- Use custom url params with value from a custom field to return the post containing the field value
- WP_Query on custom taxonomy -> Location and Activity
- Custom tag template to list posts in ASC order