It is unlikely that you will achieve this as stated. WordPress has no concept of post subsets in a query, it only understands it as single set as results.
If you don’t need pagination you could just retrieve the set unsorted and re–sort it with PHP code. If you do need the pagination this would probably be extremely inconvenient and require massive custom SQL.
PS avoid query_posts()
, it’s outdated and harmful.
Related Posts:
- Sort Order for a Custom Query in a Post Type Archive Not Working
- Select All in Parent Category, Group by Child Category?
- WP_Query -> sort results by relevance (= most tags / taxonomy terms in common)
- WP_Query post at custom position
- query order by date on custom type: wrong order
- Re-order posts in query after
- How to query different post types in specific order?
- Combining sorted and random CPT
- Previous/Next Link by Meta Value in CPT
- Wp_query: sort by PHP variable
- How to do WP_Query with two meta fields with orderby clause
- Order Custom Post Type by Custom Field Value
- Change sort order when using ‘orderby’ => ‘type’
- Having Issue on Ordering CPT by Custom Field In Custom WP Query
- WP_Query of custom post type sorted by meta_key has unexpected results
- WP_Query not resetting after wp_reset_postdata
- Post ordering not working with custom field
- Displaying Portfolio Filter by Category Order (alphabetically)
- Display Parent-Child Posts in specific order by comparing IDs in array
- How can I sort the results of a REST API response by the title of a connected custom post type?
- Order posts alphabetically with numbers but some of the posts has numbers in the title
- SEARCH QUERIES – REVERSE OUTPUT
- Wp Query sort order from custom MetaBox
- Orderby modified only for specific post types
- Custom post order when using OR relation
- 404 on Pages for Custom Post Type & Query_Posts
- WP_query orderby not working after WP4.0 update [closed]
- Query order by meta value force specific tag first
- Order Wp Query by earliest of 3 dates meta query
- Get Posts in a Custom Post Type category
- Displaying Posts Related to Other Posts by a Taxonomy Term?
- How to query for posts (in hierarchical custom post type) that have children?
- Combine tax_query and meta_query in WP_Query
- Should unaltered default loop/query return a list of custom posts belonging to a custom taxonomy?
- WP_Query pagination using only numbers instead of /page/1 on URL
- Query for posts in 2 taxonomies
- Display custom post types with custom date field value (before today) & order by custom date field
- Parent / Child formatting in a list of post of a custom post type
- How do I create an archive page for standard posts?
- Multiple post type queries (with specific arguments for each)
- Custom Post Type Loop within Shortcode
- How do I make a custom taxonomy for a CPT appear inbetween title and editor boxes?
- How to add post_type=value when editing that post type in the WordPress admin?
- Display CPT posts based on specific taxonomy
- showing custom post types of a certain category only
- Filtering WP_Query Dynamically on the Front-End
- Why get_posts() not returning only selected category posts from Custom Post Type?
- Custom taxonomies relationship
- Prioritize posts in query by meta keys?
- WP_Query orderby and tax_query
- Configuring a meta query with multiple post types that have the same relationship on a single page
- Different Ways to Query Custom Post Types?
- Possible to filter custom post type with multiple meta data?
- Loop increase number
- Custom filter for main search: how to exclude specific post_type from search results
- Inefficient Query Confusion
- find custom post type post by searching its custom field with my string
- wordpress lists similar type of posts in a custom post type
- FacetWP paging custom wp_query
- Custom post type and custom taxonomy 404 on page 2
- Cannot get custom posts by category
- Shortcode with WP_Query more than once on one page
- list posts of two post types in a single template
- How do I list a custom field and custom taxonomies for each result in a loop?
- Find Posts based on Child Post value
- Change search query in wordpress custom post type
- Sort custom posts by date and then by taxonomy
- Query custom post type that has a serialized relational advanced custom field value
- build child and anchestor three from post parent
- How can I query and sort custom-post type using WP_Query
- Custom query result empty on page 2
- How select query is generated in a Custom Post Type?
- WordPress doesn’t respect Page slug in custom post type url pagination. Keeps getting removed
- Output all terms slugs for a loop filter
- Post Query , breaks layout if a post is deleted
- Not able to get my custom search result using meta_query and tax_query together?
- Multiple WordPress Sites, Same Database but Filtered Content
- Custom Field as Custom Post type element class
- Display posts on parent post if author coincides
- WordPress query in which condition uses custom field
- How to get Current week and current date record wp query
- Error in WP Query. If variable is empty it is displaying previous post value
- Custom Post Type shows pagination (w/404) or posts_per_page query, but not both
- Help ordering custom query by Title, Ascending
- WP_Query for CPT with filter by another WP_Query
- Is it possible to add query parameters on the archive page?
- How to display custom post type ordered by a custom field date
- WP_Query and two custom fields returns no posts
- Ordering custom post type by custom field without a title
- Storing/querying custom date data
- Query Posts From Multiple Post Types
- Custom Post-type not returning the right child_of
- Create custom post order (with custom post type meta)
- Posts 2 Posts: query connected — orderby problem
- How do I hide single category post on my post page
- Get images only from a certain post type
- querying to custom field over ACF REST API
- Quering array of post types & pagination. Articles are repeating sometimes on different pages
- How can I show posts with the same tag?
- Load posts via AJAX without draft status