You would need to build your own query and pass it to query_posts i.e.
if your array of post ids is:
array (10,21,1) // corresponding to post ids.
then you can query this way:
select * from wp_posts where `ID` in (10, 21, 2)
order by field(ID,10,21,2)
This will give you a result set in the order of your post ids array.
HTH
Related Posts:
- Sort posts alphabetically by custom field value, insert divider between different letters
- How to Get All Posts with any post status?
- How can i get count from query post
- query_post by title?
- How to query_posts using meta_query to orderby meta_key AND have a secondary sort by date?
- How to return results of a get_posts() in explicitly defined order
- How to set posts per page using WP_Query()
- query_posts() in function makes global $wp_query out of sync?
- Problem with ‘post__not_in’
- Is it better practice to use query_posts, WP_Query, or get_posts to create various custom loops within a Page?
- Sort X categories by last update and show image
- Custom Post Type “Event”: chronological list of recurring events
- Sorting problem with ‘query_posts’ funcion in wordpress. Sort by custom field not working
- Total Count of Posts NOT in Selected Categories?
- query_posts sort in multiple directions
- Using database meta_values to calculate new post order using pre_get_posts or a ‘request’ hook
- Sort Posts by Multiple Meta Values [duplicate]
- orderby:date not working
- Sorting multiple custom post types without a meta key/value pair by sort order
- Tricky WP Query
- WordPress pagination showing same posts on each page
- Search breaks when querying main loop for category
- Using ajax with paging and a custom sub-query
- Custom loops, sticky posts, and pagination nightmare
- change the default order of posts only for specific categories
- odd behaviours from template tags
- Having an issue doing a WP_Query with post_content and category__and
- Custom query looking at multiple custom fields and properly sorting
- Pre-existing arguments when using queries
- Sorting the Loop by Taxonomy Value
- WordPress sorting posts by date and title using a dropdown
- Sort / Filter Queries
- query_posts with sorting on a custom datestamp
- wp_query by last month + sort posts
- If meta_key has value = 6 | Change the wp_posts.post_date to current date
- How to refine WP-Query with further criteria
- Run second query on page based on author of the first query
- Query Posts (post meta)
- How to search CPTs in draft using get_page_by_title()
- sorting in wp query based on custom field value
- Show 5 posts and than 3 posts offset with pagination
- Sorting Posts by Taxonomy thats not within the query’s $args
- allow user to edit posts made by others users based on the user role
- How to show post title in content editor in backend?
- Query the title of the page to show posts with matching category in the loop
- wp_query args with relation
- Ajaxify Post Sort
- My entry results are not consistently alphabetized
- Orderby query does not work for custom fields even with meta query
- Merge two queries and remove duplicate
- How to order posts, that have already been filtered by custom taxonomy, by their category names?
- How to add in WP_Query to every 3 posts displayed? [duplicate]
- Manipulate query to show specific post
- Ignoring ‘a’ when sorting posts
- WP Query Relations / Compare
- Pull new posts using feed
- Seach and categories not working when ignoring sticky posts in main loop
- posts_per_page increment additional post
- Custom WP_query and integrating into theme file
- wp_remote_post and form post
- Display three sequential posts on each page load, without repeating previous
- Pull posts from all categories if quantity is not met?
- Query_post 5 post first / last of post_id
- Calling body_class and wp_nav_menu for a different post
- Query only title/field/featured media of posts [closed]
- Ordering Posts By Meta Data
- Combine WP_Query with array of custom data to single loop without breaking the pagination
- Wrap group of wp query posts to parent div by date/year
- query_posts() doesn’t seem to be called in my page
- Filter posts by current date ( WP Post Carousel )
- Modify query to exclude certain ids and certain parents and its corresponding children
- Main site single-property.php design, as homepage of a multisite
- Some doubts about how the main query and the custom query works in this custom theme?
- Fetching $_POST from Page Template into functions.php
- Create a hierarchical loop at predefined markup requirements
- How to order by datediff in WP loop?
- Imported Content Doesnt Show Up On Frontend
- how to exclude store in clipper theme wordpress code php
- Sorting posts by meta values: 2 different orders
- Ordering Posts by parent category, name ascending
- How to display most popular post by views count in WordPress?
- No duplicate tags by category
- Custome column sort by date not title
- Display post list within category list sorted by name [duplicate]
- WordPress custom post type
- Optimising specific Query with ACF meta objects
- Order posts by ACF checkbox
- display news with pictures 3 small and one large (loop)
- query_posts() with multiple meta data comparisons
- Sorting is not working in WordPress WP_Query
- How to sort a WP_Query array by post_name after an array_merge();
- Sort Posts By Custom Field Date
- Why I obtain this WP_Query strange behavior trying to select posts having a specific tag?
- Why I have this strange behavior when I try to exlude the featured post from posts visualization?
- Custom query posts error
- How to organize a WP_Query’s list of posts by category and display category title?
- How do I control the fallback query after the original query returned cero posts?
- Query category-specific, paginated posts and allow viewer to change sort order
- When should you use WP_Query vs query_posts() vs get_posts()?
- Sorting: custom query with orderby meta_value_num THEN by title