get_posts()
is a rather generic wrapper for retrieving set of posts and just that. As such it purposely unmakes some of the arguments typical for loops.
Specifically it ignore stickies:
$r['ignore_sticky_posts'] = true;
So if you want more loop-like behavior you should be using instance of WP_Query
object instead.
Related Posts:
- Meta query terribly slow
- Get result from meta_query() between two numbers
- Query between two meta keys
- Archives for custom post type based on a “date” meta value
- How to check a single number value against an array of meta_key values?
- get_users meta_query
- Meta query with multiple logic (AND / OR)
- Best practice – Meta Query vs. post_clauses for “left join” ordering
- meta_query with multiple values
- Return posts with specific meta key first, but the rest in alpha order by last name
- LIKE %…% Meta Query
- Multiple Values stored as array in Meta Query
- Documentation for post meta
- Advanced orderby with multiple meta_query
- Using get_terms() with meta_query parameters
- WP_User_Query with meta_query array relation ‘OR’
- meta_query problem
- Very slow query with meta_query on large database
- How to exlude posts that have certain meta_value?
- meta_query results not the same with and without spaces
- meta_query all posts between to ages
- How to make a WP REST API query with meta_query in WP4.7?
- WordPress Core – Optimizing meta_query generated SQL?
- Nested Queries using meta_query
- Display no post when metavalue is 0
- Wildcard with LIKE operator in Meta query
- Meta Query Compare with Date
- Does meta_query working with value paramater higher then 999?
- How to pass user meta_key and meta_value (values as array)
- WP_Query ordered by meta_value_num doesn’t fetch posts without this meta field
- Query Multiple values for same key
- Custom post type archive with rand and meta_value
- Comparing a field with several values at once with meta_query
- Meta query with a sub query group possible?
- meta_query compare=’!=’ with multiple custom fields
- Query posts with numeric meta values within a given range
- meta_query not working on live site
- How to query post only with different excerpt?
- How do you get Posts by multiple meta_keys and meta_values with the Rest API V2?
- Query custom field with date
- Meta query with regular expression does not work
- Searching in title or meta, with a tax query too!
- WP_Query with meta_query no results
- Documentation for post meta
- Wp Query custom search by meta query
- Pre Get Posts / Multiple Meta Keys / Orderby Single Key
- Meta query – How to display a null meta key
- WordPress Screwing Up ‘orderby’ => ‘meta_value_num’ in ‘pre_get_posts’
- How to query wp_postmeta table for any specific meta_value?
- User meta query results in PHP notice: only variables should be passed by reference
- meta_query with multiple values optimization
- Meta query date column add [x] days to validate
- Get a single post ID based on an exact match of 1 or more meta values
- wordpress Meta_query between numbers range (not working)
- meta_query with multiple key
- Orderby doesn’t work like expected on custom query
- I would like to have add_post_meta to return the ID instead of true or false
- Order by meta value
- meta query based on month regardless of year
- Extend meta query arguments
- get_posts( $args ) return empty data
- meta_query in WP_User_Query not working – returns every user, not just users where key & value matches
- meta query or with meta value
- meta_query array in ‘values’ returns an error
- how to search all user meta data that have value like “vivek”
- get_users with Serialized Custom Meta Value
- Unable to use meta_query between currency values when value is over 1 million
- Filtering all posts AND sticky posts through meta_query
- How to cache the results of a query and display the cached results
- How to Ordering by user meta
- How to send variable to wp meta_query value?
- get_user can’t read variable
- meta_query check multiple date formats
- How to count items of meta query?
- WordPress meta query with meta serialized data array value
- Reading Content in an Array as it relates to a meta_query
- wordpress meta query with multiple meta condition causing a load on server and slows down the server..!
- Meta_Query with multi select values
- Trouble with calling an imploded variable in an array
- Memory Leak in Processing Large JSON file
- Meta Query returning empty array
- Query for user roles and their skills
- Get Posts from Custom Meta Query
- like_escape notice when using LIKE in meta query
- meta_query for user ID in array
- Display query post based on two orderby value in wordpress
- How to fetch WP_User_Query with multiple role arguments [duplicate]
- How to get meta value based on latest post id with group by term name
- Querying by meta key and value
- How to compare date in post meta value
- Multiple Queries with meta_query
- Which Meta Query Compare Method Should I use?
- Sort posts by post views and consider meta key
- How to output meta_key in wp_postmeta?
- meta_query and strange orderby behaviour
- Sorting not working with get_posts
- Get_term with meta_query
- Meta query with string NOT ending like pattern
- acf/save_post affecting WP_Query results
- Merge meta_value’s into a single row and then loop