I’m not clear on whether you’re looking for one big query that returns all the ‘track_trip’ and ‘training’ posts, sorted by the two different custom meta fields, or two separate queries. But either way, you’ll need to use a custom meta_query. You will probably also need to orderby meta_value_datetime. Note in the “‘orderby’ with multiple ‘meta_key’s” section of the WP_Query documentation you can orderby an array of values, if that’s what you’re looking to do.
Related Posts:
- Filtering a WP_Query meta_query by numeric values isn’t working
- Query by 2 values of a repeater ACF field
- Query current and future events, ordered by begin date
- Display posts if a custom field value is equal to another custom field value
- Remove duplicated values from a loop
- Custom Post Types not showing, custom WP_Query
- Custom Post type and Custom Field WP_Query
- Display multiple custom post types and sort them chronological by one of their fields
- WP_Query order by custom field, then randomly order some of results
- Troubles with acf/save_post and WP_Query
- Query custom post type with ACF Date
- Stuck in Order by more then one
- Order Custom Post Type by Custom Field Value
- Query Custom Post Type Taxonomy term with multiple parameters
- Query based on custom fields start and end date
- Why is my WP Query not returning first result’s post meta?
- Group by custom field value (start and end times)
- Using WP meta query to show custom post types by a start and finish date
- Create if else for post types in WP_Query ‘post__in’ values
- Sort custom posts by date and then by taxonomy
- Using ACF values in nested WP queries for CPT with date values in the past
- Filter posts by their related field’s custom field
- Wrapping an unknown amount of posts inside separate HTML Containers during WP_Query loop
- Show specific posts with WP_Query using ACF Post object
- Linking posts together with Advanced Custom Fields “both ways”
- Custom Field as Custom Post type element class
- How to query posts by meta keys AND under specific category?
- Custom Post-type not returning the right child_of
- Display ACF object field data using Elementor Custom Query
- WordPress duplicating posts from single loop
- Custom fields disappearing when a custom post type is assigned
- Advanced search form with filters for custom taxonomies
- custom post type search by reference id
- tax_query not working in template
- Custom Taxonomy Not Showing in Front-End When Outputting a Custom Post Type with WP_Query()
- Print current post category during WP_Query
- Multiple Custom Post Type queries, how to DRY it up
- ACF repeater field usage
- WPDB for post count on post
- post_per_page ignored in WP_Query
- Pagination 404 on Index with custom query
- WP_Query parameter conflict
- Retrieving meta-box from a custom-post-type
- Cannot get custom post
- Custom post type and standard post not displaying or working
- Batch Extract Date from post title and put into ACF custom field
- Display custom post type for specific user
- Get all post from a post type
- A faster way to query custom post types with multiple conditions?
- Custom Post Type Archive Pagination
- List all Custom Post Type posts excluding certain Taxnomy term
- WP_Query: Posts within category OR custom post type
- Custom post type pagination error
- WP query_posts group by meta field related
- How can i show ACF in post excerpts
- WP Query from two Custom Post type fields as statement
- Grouping custom wordpress post types by acf value
- Set Post Private if no linked Post Objects (ACF)
- Show in an entry a Custom Post Type associated to a post
- Apply category query clause to posts of custom type
- custom post type and a “sticky” position taxonomy
- Display post count for a specific month
- Query to Exclude Child Pages from Custom Post Type Archive
- WP_query has incorrect wp_posts.post_name = ‘asc’ when I have custom post type called ‘order’
- Randomizing WordPress Custom Post Type Sorting Through Them Without Page Refresh
- Order posts alphabetically with numbers but some of the posts has numbers in the title
- How to output custom post type title on custom page with category next to it?
- How to sort by multiple values in a nested WP_Query
- ACF meta_key and meta_value break loop
- search results to show individual ACF fields from inside custom posts
- Videos Post Type with Custom Filters
- Staggering featured post using ‘sticky’
- Ajax load more inside custom post type taxonomy
- Use output of wp_dropdown_categories($args)
- Create a custom wp_query from a specific custom post type with specific taxonomy
- Values show up in custom home page but not in custom post pages
- Display related post content and custom field content
- SQL LIKE in WP_Query
- How can you use a page for a custom post type?
- Query breaking with ‘posts_per_page’ => -1
- WP Query with multiple post types ordered by custom meta date then published date
- How to load custom post type plugin after acf options page (or get settings from there another way)?
- CPT Efficient way to display posts from different categories with custom query
- How To Loop Through list with Custom Post Types
- Query Pulling the same post twice
- Use Tags to Query Associated Multiple Posts and Get The Average Of Custom Field Values
- Custom Post Type + Category archive
- $post breaking container loop
- Values inside a custom field to determine which category posts to display
- WP_Query get posts where post_name is empty
- How do I sort post listing by child post count?
- Pop up showing same content on all posts display.
- Collection of fields in a single post
- Querying meta values within an array
- Count of posts with meta_key filled in?
- Filter Custom post type by another Custom post type
- Archive page – problem with pagination
- Are custom posts included when getting a categories’ posts?
- Retrieve a post with its ACF repeater fields in wordpress
- Query order by meta value force specific tag first