Jus add the parameter 'author__in'=> array( 2, 3, 5 )
to $args
and pass the author ID or IDs. You’ll get the results.
$args = array(
'author__in'=> array( 2, 3, 5 ), // array of authors IDs you like to include
'post_type' => 'post',
'post_status' => 'publish',
'posts_per_page' => -1,
'caller_get_posts'=> 1
);
And I don’t think you need the $my_query = null;
to nullify the variable before declaring it.
Related Posts:
- Search posts by post author name
- On WordPress Search, how to search post from Author meta also
- How to hide meta from search result only on pages?
- Including categories in search results
- Hook that get’s triggered when the author of a post is changed
- the_author() returns empty string
- Prevent Authors from viewing each others Posts
- Display Random Author with Details in Sidebar
- Search Custom Post Type Pages and Custom Fields in 2 Dropdowns?
- How to show list of posts by author and category?
- WordPress: How to get the current logged in author page URL?
- How to add editor’s name to entry meta byline?
- Different permalink for posts and authors
- How to display posts by current user/author in a custom page template?
- Display all search results
- Query posts distinct authors
- Restrict the Number of Posts an Author can Publish (over time)?
- Get the user type of an author
- Search not working with title and content
- Show the title of the latest post by author
- Find most recent authors
- Show author post count in sidebar – Variable
- Get current users post URL?
- Get the author of the latest revision
- Filter posts by author and category simultaneously
- how to hide specific post from google search
- Custom Post Type & Author not associating, user post count is 0, api doesn’t return author in post objects
- Guest Author – How to modify my custom function code if the guest author URL will follow a particular pattern/format?
- Post author is changed to admin after his post is modified by admin
- How to search only by post title and category?
- Search widget breaks when using multiple loops?
- Get all posts by post_author
- Pagination not working on custom query
- How can I control multiple editing of wordpress posts?
- Multiple authors for single post without plugin
- Limit number of posts a user can make per minute?
- How can I get all posts data from within a paginated search result?
- Authors in menu, template list post by author
- Show the author’s count of total amount of posts assign to a custom taxonomy term
- Author must complete profile info before they can publish a post?
- WP rest api returns 404 only when author param is used
- Search query – exact post title match
- How can I list random authors from current post category?
- pagination hook doesn’t work with search results
- Search for posts based on their url in the admin?
- wp_query ‘s’ parameter does not work with custom post type
- Differentiate between posts and pages in search results
- Count search results in heading
- Private Posts/Pages & Search
- Display number of posts via adress bar?
- How can I show wordpress posts based on author?
- Show info to author only
- Tags to Post-ID mysql query. Tag Search
- Auto “expire” all of an authors posts on spcific date
- How to get the user meta data for a post?
- How to change wordpress dates to native language (even if the languge not available i wordpress)
- Limit posts per author role (excluding admin) in home page
- Guest Author – How to display posts on /author/ archive page
- How can I show many posts an author has per week?
- How to give capability (publish contributors posts) to author role?
- Whitelist Author of Private Post
- Show posts by a custom post author
- How to filter my search in post if contains a word in title, content or excerpt?
- Search results posts_orderby and ID
- Posts and Attachments with “Published” status in Search
- Getting the current author (it has changed) of a post, not the original author
- Showing author page if user has no post
- How do I change the core post search algorithm? Where is it found/constructed?
- Display Notification Bar on Header on Certain Post Count
- How do I retrieve a users’ last 5 posts?
- obtain the author id given the post id
- Show comment number per author per day
- Get all comments of author’s posts
- (solved) getting post author’s user role
- Change all author links in Blog roll
- Display author’s name and avatar in post’s sidebar
- How to add add more properties to WP_Post object in search results loop
- static landing page leading to author specific pages w/ “live” content
- If contributor has published 2 or more posts then show otherwise hide
- All Posts Linking to Author Posts directly
- Total number of posts in query (category/tag/author/search results/main page…)
- Change post author without using wp_update_post()
- See if a post has a specified tag
- Is it possible to lock all new and existing WordPress posts to one specific author?
- How to get the ability to change the author of a post
- Echo Text If User Is Logged in But NOT the Author of post
- Only allow posts with a specific term to only be viewed by other authors with the same term in their post
- How to limit author related post listing ?
- Restrict displaying posts to the poster itself (in Back-end)
- Get total post from an author
- Send email to author of post on post submission
- How can I set a maximum allowed post size and number of posts submitted?
- Get x recent posts by author?
- Change Author Name to Sitename on Frontend
- Exclude a category of posts in author template
- Get latest author posts inside the loop
- Why does WordPress search returns same number of results for every search query?
- Author Avatar as default first image
- Hide parts of the post content after typing it’s name or searching it by category
- search content of pages and list in wp-admin