try to use a new WP_Query, when you use get_posts you’re using the main WP_Query this has hooks that other plugins can use to alter the query.
something else i saw is that you’re using include key which is not valid
$my_query = new WP_Query( array(
'post__in' => array( 1633, 1634, 1635 ),
'post_status' => 'any',
'post_type' => 'attachment',
'post_mime_type' => 'image',
'order' => 'ASC',
'orderby' => 'post__in'
) );
Related Posts:
- When should you use WP_Query vs query_posts() vs get_posts()?
- When to use WP_query(), query_posts() and pre_get_posts
- How to use the_posts_navigation for wp_query and get_posts?
- WP_Query vs get_posts
- meta_query: using BETWEEN with floats and/or casting to DECIMAL
- Get posts from Network (Multisite)
- How to order by post_status?
- Using get_posts vs. WP_Query
- Delete all posts from WordPress except latest X posts
- Sanitation needed for WP_Query or get_posts calls?
- Differences Between WP_Query() and get_posts() for Querying Posts?
- Get Recent Posts by Date in Multisite
- get_posts with multiple categories
- get_template_part in for loop
- Use of caller_ get_ posts
- How-to exclude terms from the main query the most performant way?
- Is it possible to select against a post’s parent’s fields with WP_Query?
- Query all posts where meta value is empty
- Get posts by meta data OR title
- Get_post() with meta_key when compare is a date
- get_posts not finding argument: post_name
- Meta Query with date and time on the same Day before given time
- Get posts with condition on comment meta value
- Function to check if author has posted within the last x days
- Use post__in and post__not_in together?
- What should I use, get_posts or wp_query for less CPU load?
- Different Results with query(‘s=computer’) vs get_posts(‘s=computer’)?
- How to get post from all Blog Multisite to the Main Site?
- Hide posts from users with a specific role
- How to order posts by custom WP role?
- WP Query post meta value
- Get all posts without tags
- get_posts() seemingly ignoring post_type
- Can not switch the queried post in pre_get_posts hook
- How to find out what “Blog pages show at most” is set to [duplicate]
- Count posts returned by get_posts in external PHP script
- How to hide post content/meta from everyone except the post author and admin
- Trying to check and see if a post has a featured image outside of the main loop
- WP_query category__in not working, only pulls from first category
- SQL User Query by Multiple Roles using PHP
- SELECT * FROM $wpdb->posts WHERE ID > 160
- Adding multiple post queries with parent and children to page – Best Way
- How do you Query posts with nothing in common?
- WP_Query, tax_query and term_meta: How to?
- Get posts for last working week in WP_Query
- get_posts – get all posts by array of author
- Create a sitemap without a plugin – get parent pages only?
- Creating a custom search for a specific post type
- Storing query variable and then using wp_reset_query
- get_posts – find out if querystring was crap and fallback is used
- How to order posts in wp_query by the user role (2 roles in array)
- While creating Block Themes in WordPress, how can I query custom posts for an Archive view?
- Get posts for which a custom field is not present, with get_posts
- Creating query to show which editor (classic or block) was last used to edit a post/page
- get_posts() not working with multiple statuses
- Return only post(s) which have post_excerpt
- Return Taxonomy/Term Information with Posts (WP_Query/get_posts)
- Help with WP_Query – Too many mySQL queries
- WP_Query() and get_posts() can’t handle over a thousand posts?
- add active class based on permalink and url
- How to display user order by role
- Weird orderby => post__in issue
- How can I query users by custom role?
- Conflict with get_posts and the_content
- WP_Query post_parent parameter always returns children of current page
- get_post_meta slowing down my page load (in a plugin)
- How to show more post at a given category?
- Get posts by list of post IDs ordered by those IDs?
- How to count posts with specific arguments
- Check return value of get_posts
- Reset WordPress Post Query to default
- Best choice for multiple loop in page?
- Get all posts which was posted on X Days WordPress
- Query post with meta value in set of values
- meta_query: check if number exists
- get_posts output always same post
- Use WP_Query or query_posts() or get_posts() for optimizing a site?
- get_posts always returning the same number of posts = 5
- “paged” in WP_Query returns 0 posts
- Specify strict ‘order by’ in WordPress query
- get_posts() and global variables
- complex get_posts() query to select child pages
- How I can change the condition or compare operator for WP_Query in pre_get_posts
- Check if searched number is within the post meta value
- Show menus to one admin username
- get_posts custom field
- Using get_posts to get posts based on a checkbox value with Advanced Custom Fields
- How to apply a function to a metadata value before launch a WP Query?
- Posts query according to meta box date
- Woocommerce: order posts by meta key
- WP_User_Query and user posts
- Need help understanding this WP Query [closed]
- Link Author URL’s based on a custom field
- How to get posts by category and by choosing a taxonomy term?
- How to access $wp_query object from array of posts given by get_posts?
- Sort by multiple columns using get_posts
- How to cache wordpress get_posts query using transients?
- When to use WP_query(), query_posts() and pre_get_posts
- Equivalent of url_to_postid() for non-post URLs?
- query loop “inherit query from template” prevents setting sort order