You need to set ignore_sticky_posts to true in your query arguments. This way you exclude sticky posts and only focus on the post ID’s array being passed to post_in
'ignore_sticky_posts' => true,
EDIT
If this does not make much sense, please see my answer here to similar question where I have explained it a bit better. Be sure to check it out
THE CODE
$r = new WP_Query(array(
'posts_per_page' => 5,
'post__in' => $sticky,
'meta_query' => array(
array(
'key' => '_thumbnail_id',
'compare' => 'EXISTS',
),
),
'post_status' => 'publish',
'orderby' => 'post__in',
'post_type' => array( 'post' ),
'ignore_sticky_posts' => true,
));
Related Posts:
- Display products from specific category in shop page
- In loop: posts have thumbnail AND other variables
- Exclude post on loop by multiple meta key value
- How to query ‘posts_per_page’ to display a different blog posts index template?
- WP_Query doesn’t get sticky post at the top, when used in a page template
- WP_Query on custom field and order results
- Show Sticky Post at the top but do not show again in the loop?
- Any number in meta key (wp query)
- WP_Query condition affects posts_per_page count
- Array as ‘key’ in WP_Query
- How to display the featured image for each post?
- How to provide meta_key array to wp_query?
- Wp_query with 2 meta keys and array of meta values
- Meta query compare for ID’s greater than specific ID
- How to remove only the latest sticky post from the loop
- Use have_posts() with array of post results retrieved by $wpdb->get_results
- WP_Query not returning correct result with meta_query parameter
- How can I have sticky posts while ALSO showing posts from a specific category using one WP_Query?
- show most viewed post
- Meta Query if Values Don’t Exist
- WP_Query causing links to not work
- Custom loop – Isolating post meta output depending on current query taxonomy terms
- Display First posts without the default featured image
- Multiple loops on index page with sticky post and pagination
- First post outside of loop, homepage only?
- How can I display sticky posts at first in wp_query?
- Display only posts with thumbnails
- Nested meta_query with multiple relation keys
- WP_Query vs get_posts
- ACF Relationship Field Search Filtering [closed]
- Query Multiple Post types each with own meta query
- How-to exclude terms from the main query the most performant way?
- Pagination with WP_Query is buggy – working for some pages, but not the others
- How to place a loop within another loop?
- Is “orderby” in WP Meta Query conflicting with Meta Query?
- Pagination/infinite scroll with WP_Query and multiple loops
- Ajax Infinite Scroll In Custom WP_Query Loop Not Working
- How to change a custom query into a standard loop?
- Sort users by meta_value_num
- meta_query with array as value
- Injecting content with $wp_query->current_post restarts from zero on paged pages. How to inject content after X posts, regardless of pagination?
- exclude custom post type by meta key in wp_query
- Using WP Query to search within ALL keys in meta query
- WP Query – Get WooCommerce Products with variation that is in stock
- Meta-value query
- Why does the_content not work like others for a set post id?
- pre_get_posts filter meta_query without conflicting existing meta_query
- How to limit total number of posts in wp query loop?
- Programmatically set ‘meta_query’ for filter
- Complex Orderby Parameters: How to query with multiple orderby parameters using meta_value_num?
- How to vary post loop results layout and resume?
- Adding an array from a query string to a WP meta_query
- Query multiple meta values
- WordPress Loop and $post
- Excluding pages in WP_query using ACF
- reset to main loop doesnt work
- Some doubts about how the main query and the custom query works in this custom theme?
- Retrieve posts using thumbnail id as meta key
- Stuck in the query loop
- Need to convert string of term ids into comma separated integers for use in an arguments array
- How can I allow sticky posts but cap the query to 1 post?
- How do I get my custom query to work with search results after the first page?
- Query posts only without featured image
- How to use WP_Query() on single.php?
- difference between querying database and using the loop
- Loop increase in while loop not working
- Is this meta query problematic?
- posts archive page – closing WP_Query loop correctly [closed]
- Appending to existing WP_Query’s meta_query if exists
- AJAX Breaking Offset Argument In WP Query
- Continue or break the while loop
- Get meta_value of a specific meta_key from all posts belonging to a specific custom type
- Custom query filter by ACF date custom field
- Nested array issue in meta_query
- Error in meta_query not get result
- Function using get_posts() with tax_query not working when called from functions.php
- meta_query with array as value with multiple arrays
- Why doesn’t my WP Meta Query return any results?
- How to make the ‘request’ filter work?
- meta_query – check for multiple meta values in key which holds an array of values
- How do I stop the same post showing multiple times in a archive?
- Searching for a specific month in a metadata saved as Timestamp (Wp_Query)
- how to get custom attachment url?
- WP_Query on custom key and value
- Sorting with meta_query and multiple, optional meta keys
- WP_Query & Duplicate entries
- WP_Query how to add a thumbnail to the first post from the last 5 posts?
- Query by meta value (add a dropdown of all values)
- Calling a function with WP_Query only ever brings the first result
- WP_Query returns empty if meta_query has more than 7 values
- WordPress meta_query not working
- Create multiple sections for all categories and then queries all the posts for each of those categories
- Using orderby with 2 meta keys
- Next / previous posts link doesn’t show up with Posts 2 Posts
- Passing conditional arrays to WP_Query() [closed]
- Carousel Loop only duplicating
- How to show featured post first, then separate loop for other posts
- Get all user with both meta_value
- Using ‘meta_query’ with the ‘pre_get_posts()’ hook disables searching for post titles
- WP Query returning all posts when Meta_query is null