If you just want to return published posts, you can exclude the ‘post_status’ argument as by default it will just return published posts only.
Having said that, the array works for me too though.
Related Posts:
- get_next_post() not working with future post status
- Get Posts Under Custom Taxonomy
- How to show related posts by category
- How to Display a List of Users Who Have Made at Least 1 Post?
- get_children() Not Working with orderby Parameter
- How to get all posts related to particular category name?
- get all posts ID from a category
- Let private posts stay in status “private” after edit through “editors”
- get comments and get posts in loop
- How to know if get_posts() failed?
- How to display posts by current user/author in a custom page template?
- How to get previous 10 days post from a specific date – WP Query
- Show the title of the latest post by author
- featuring old articles without messing up with the archive
- Setting pagination for images attached to a post
- Setting post meta data to random value during post status transition / on publish
- Query only Posts from Both of Two Category?
- is there a better way of combining this?
- How to change post status from publish to draft using hook in wordpress?
- Hiding by default specific post status on backend list?
- Enable commenting on front-end preview page for pending posts
- WordPress get posts by date without query_posts
- Custom Post Status Posts viewable to the public
- How can a guest view the “Pending Review” Post?
- Posts are not showing up on particular category
- How do I batch create revisions of all posts?
- add filter to “quick edit menu” in wordpress admin
- get selected post using $_GET
- ‘transition_post_status’ only fires when pressing “Add New”
- How Can i Get 5 Recent Post Title With Corresponding Link?
- Can I set and show “important” post in my blog?
- setup_postdata doesn`t seem ot be working
- What differences are there between a Privately Published post and a Draft post?
- Encrypt / Decrypt Post Title and Details
- Get Posts via Taxonomy Term Name with Space
- Get specific posts by ID in wordpress
- Update post status from “publish” to “trash” for half of posts
- Automatically republish old posts
- How can I set a Post’s default visibility to private and pending review checked
- get_next_post() and get_previous_post() return wrong posts
- how to remove dash (-) post status from post title on posts listing page wordpress
- Get posts by name and taxonomy term
- Inserting custom data to the_post() during loop
- How do I restart my loop with get_next_post()?
- Get mixed category random posts
- WordPress not opening posts with only numbers if permalink is post_name
- Limit popular posts by days
- Why is querying posts messing up my pages?
- get_the_content(“more…”) returns full text
- How to change post status from frontend?
- Insert Content In Between Post Feed
- Post Loop Missing Most Recent Post
- Get Posts Under Custom Taxonomy
- Include sticky posts on the static page front page
- Posts and Attachments with “Published” status in Search
- Get attachments for posts that belongs to a specific category
- Pagination with an array of post objects?
- Any way for get_next_post() to use the actual post order instead of publish order?
- Admin – create custom post status and display above table
- Restrict edit, but allow preview for custom post status
- WordPress capabilities on pending post status
- Posts loop displaying the same post data
- How to get posts from a current post’s month?
- How to get posts and comments amount per hour, per year and per month?
- While loop articles – if statement order
- Count number of posts of current month
- why there are so many posts whoes post_type is revision? will these records waste too much database space?
- How to Get Posts, Including Private Ones?
- $post->post_type not working
- Random posts from a pool of posts
- how can i allow users to view their own pending posts in a front-end page
- Conditional Tag for has post [closed]
- How to get post content from an array of ids?
- Display Posts with template on a Page
- Number of displayed posts
- Why posts array is empty?
- How to create a “latest news” page showing a list of posts from blog category
- Post Filtering by GET URL parameters
- How to give classname to post if post has no content?
- Custom Articles page only showing a limited number of posts per page
- Related Posts function not working
- Is there a way getting post fields using `transition_post_status`
- How to get post with slug and exclude categories
- What function publishes a post when you click the publish button?
- get_posts not pulling the correct number of posts
- Get x recent posts by author?
- Post Status Frontend Announcement
- Display amount of pending posts in back/front end
- If post does not exist, do something
- List latest posts with least comments in WP-Admin
- Internal linking to posts permalink fail because of spaces and stripe at postname
- Showing posts for today and future
- Get posts from current category?
- How to add content above footer in posts from specific category
- Show Last Revision Of Post That Has A Published Status On Single Page
- How can I restore posts from ‘trash’ with their previous post_status? – WordPress
- How to show multiple posts thumbnail, title and date in widget
- I need to create “View Profile” and “Edit Profile” links by incorporating the Post Title/ID, but can’t seem to manage it
- Show only posts with titles/permalinks that do not contain certain words
- How to merge the content of posts that have the same title?