I just ran into this with WooCommerce. I ended up passing the IDs I needed to a variable for safe keeping, and then hooking a function with extremely low priority. That worked fine. I figure woocommerce or what of my cleint’s 8000000 plugins was overwriting post__in.
add_filter('pre_get_posts', 'assign_ids', 1000);
Related Posts:
- WordPress Number of Posts Not Changing With posts_per_page
- How to limit the number of posts that WP_Query gets?
- Should we trust the post globals?
- How to Change Order of Posts in Admin?
- Random sort within an already sorted query
- how to get a different html for odd/even posts?
- How to exclude latest x posts from a paginated query?
- How to know if get_posts() failed?
- Using $wpdb to query posts with meta value containing current post_id
- Query posts from current year
- I have over 4000 posts, will querying some of them cause performance issues?
- Duplicate posts
- Looping through posts per category gives same posts for each category
- How to show posts rank based on custom field value
- Exclude category on blog list page
- How do I create Comma Separated list of attached image ids?
- How to add posts to wp_query result?
- Trying to put an array into ‘post__in’ => array() query not working
- Order post by year DESC and month ASC
- Should ‘setup_postdata()’ be reset with ‘wp_reset_postdata()’?
- How can I display a specific user’s first published post?
- Replace Main Query With Custom Query
- Query All users that has post
- Custom Order in WP Query
- wp_enqueue_media() slows down my WP site
- How can I get all posts data from within a paginated search result?
- Search query – exact post title match
- Sorting posts alphabetical that have single digits
- Query posts from different categories in multisite
- Check if post exists
- posts_per_page doesnt work
- Sorting posts according to view counts not working
- Display page content AFTER a loop of posts
- Only display posts after current date
- Get posts by multiple ID’s (query)
- How to start with post number x?
- Exclude posts with empty post_content in wp_query
- Only display a certain number of posts, dependent on how many posts there are available in a query
- Improving WP_Query for performance when random posts are ordered
- Should $found_posts be returned as string in ‘found_posts’ filter hook?
- Query how many items to show in shortcode
- pre_get_posts query between 2 dates (date stored in custom post meta)
- how to get posts ids inside pre_get_posts filter?
- Get posts by name and taxonomy term
- WP_Query Authors OR Categories
- Get Posts that are in the current month or later
- Sticky post appears twice
- do_shortcode within post query
- How Can I Query a Specific Page From a MultiPage paginated Post
- Get Meta Key Value While Saving Post
- Most liked page not displaying posts
- Query get post,how to add comment box
- How to exclude latest x posts from a paginated query?
- Blog page pagination is not working after using the offset argument
- Posts will not display on page-mypage.php
- filter RSS feed in URL
- WordPress custom Query for Posts in Category display posts multiple times
- get query() without post content?
- How can I setup a relationship using categories in WordPress?
- Exclude the first ‘n’ number of posts of a tag from home page?
- posts_per_page option limits the number of Gallery items
- How i can limit period of post publication?
- How to setup a query to output posts by groups of five?
- Exclude current custom post on single post
- Dynamically switch template on click
- How to get posts and comments amount per hour, per year and per month?
- Get all custom post types excepted some…
- Get all comments of author’s posts
- First x post with another template then the others
- Why Query is returning empty array?
- Delete all drafts?
- Wrap every month posts in div
- Inner join overrides Advanced Custom Fields plugin’s get_field [closed]
- meta_value timestamp older than now
- Counter is skipping post when I still want it visible [closed]
- Do not show children of a category
- Can’t get full post title if there a spaces in title
- How to get all post_parents of a post?
- Query for first 3 posts to change the look and feel
- Why posts array is empty?
- Query posts and filter at query time by value of custom meta
- Run query_posts if SESSION is empty?
- Very complex post query
- Delete post revisions only for a single post
- How to give classname to post if post has no content?
- Display post by click on the link
- Queries take 120+ seconds on my large WordPress site
- Exclude some posts from displaying in wp_query based on some condition
- Related Posts function not working
- How to retrieve certain number of images from a wordpress post?
- Custom Post Limit for homepage only without plugin?
- How to convert query sql to shortcode in wordpress?
- WordPress loop not working on static front page
- Some doubts about how the loop work (trying debugging it)
- WP_Query articles order by offset in collumns
- How to display only one category in a custom post type?
- Adjust the order for returned posts
- Export all posts to import as product items
- get last post’s link with SQL query
- Trim posts from WP-Query?