I had a similar aproach some days ago
//.....
'meta_query' => array(
'relation' => 'OR',
array(
'pin_clause' = array(
'meta_key' => 'pin_to_top',
'meta_type' => 'NUMERIC',
'meta_value_num' => '1',
'compare' => '='
)
),
array(
'date_clause' => array(
'meta_key' => '_EventStartDate',
'meta_type' => 'DATETIME',
'meta_value' => '$today',
'compare' => '>='
)
)
),
'orderby' => array(
'pin_clause' => 'DESC',
'date_clause' => 'ASC'
)
//....
I don’t know if I got your names right, but I think it will help to understand the trick.
Related Posts:
- WP REST API: Order posts by meta value (acf)?
- sort by date in Advanced Custom Field
- Display post in order of ACF checkbox?
- Order get_terms by multiple meta_values
- Multiple orderby date arguments
- WP Query with meta queries
- ACF order relationship by date
- Filtering multiple custom fields with WP REST API 2
- Ignoring initial articles (like ‘a’, ‘an’ or ‘the’) when sorting queries?
- How to Change Order of Posts in Admin?
- How to import CSV into Custom Post Type custom fields?
- ORDER BY custom field value
- Sorting: custom query with orderby meta_value_num THEN by title
- ACF – get fields from group
- Order get_terms using a Custom Field
- Front end form to create a custom post with preview
- Different post sort order within different categories
- update_post_meta and update_field ony working when saving the post
- How to get “Additional CSS Class” for ACF Gutenberg block
- Advanced Custom Fields select field : How to echo the label, not the value? [closed]
- How to get order of posts?
- ACF: get_field() returning false [closed]
- Generate a excerpt from an ACF-wysiwyg-field
- How to order users alphabetically by their last name?
- Adding custom fields to the header.php
- Sort posts by tags in category pages
- How to get_terms() only of terms matching an ACF meta value?
- Order posts by meta_value even if meta_key is not filled
- How to sort posts by last name (2nd word) on ONE category only?
- Pods cms and “advanced custom fields” plugin
- Adding a body class with ACF
- Returning all radio button options when using Advanced Custom Fields
- How can I custom order the results from wp_list_categories?
- WP_Query -> sort results by relevance (= most tags / taxonomy terms in common)
- Custom Post type sort order not working in the admin area
- How can I set a default listing order on the admin page for a custom taxonomy? (without plugins)
- wordpress REST-API upload image to ACF
- How to sort a table of custom posts by column containing custom field
- Order by custom field date?
- Query between dates using Date Picker fields
- Order and group posts by acf by month and year
- Get the label from ACF checkbox [closed]
- Advanced custom field – gallery – display one random image
- Revolution Slider Orderby Two Custom Fields
- Order Custom post type loop by custom field (datepicker)
- How to update a custom post title from a front-end form using ACF fields?
- Ascending sort order for monthly & category view, i.e. ?m=201204, ?cat=4
- Showing an ACF field in admin posts dashboard
- Google Places API With ACF [closed]
- Check for the existence of custom field
- Vimeo thumbnails [closed]
- How to choose a sort order (for posts) per category? (ideally when creating a new category)
- pre_get_posts filter using numeric meta_query comparison (from dates)
- ACF + contact form 7
- Is there a way to export Advanced Custom Fields data?
- How to add a custom field to quick edit
- Customize the Sorting Dropdown in WooCommerce
- ACF Repeater Field, need IF statement for if sub field has content
- Can not create fields in ACF with code
- Orderby Post Views
- get_terms orderby name as numbers
- Gutenberg First Block on Page Conditional?
- can’t get query to order posts by acf datepicker
- Using meta_query and custom fields within pre_get_posts to return posts within a numerical range
- Comparing arrays with meta_query in pre_get_posts
- Set default date in datepicker of an advanced custom field
- Advanced Custom Fields plugin : displaying a YouTube video
- Arrange and separate posts
- Advanced Custom Fields – Check if multiple get_fields exist?
- ACF – Custom fields have dissappeared [closed]
- Error in Validate Field with ACF plugin in WordPress
- How to order by just the Time Field in Advanced Custom Fields
- Using Gutenberg parse_blocks Function With ACF Custom Blocks?
- Query pages for use of a flexible content layout
- WordPress Gutenberg, update post content programmatically
- ACF get field label in custom code
- Sorting posts by multiple values, combined
- Meta query with order by another custom field
- ACF repeater field with meta_query
- Custom column sorting in WordPress admin post table
- How to add custom fields in rss feed
- Get specific repeater row (via advanced custom fields) based on Meta Query with Wildcards [closed]
- How to customize a divs background dynamically using Advanced Custom Fields Plugin?
- disable (read only) a field if within a custom post type name
- How to update custom taxonomy meta using ACF update_field() function or any other wordpress function
- Replace post’s “the_content” with ACF value
- ACF if / else checkbox [closed]
- PHP echo stripping formatting in Advanced Custom Fields [closed]
- Thumbnails generated from PDF in the “Media” section – how to show them in theme template?
- Post Object field orderby (Advanced Custom Field)
- How to count ACF Flexible Content Rows?
- ACF Plugin – Random Gallery Image with wp_get_attachment_image()
- How to change the page title from functions.php
- Sorting custom admin column by value
- Acf Pro repeater field returns null [closed]
- Query between dates using date picker filter breaks in WordPress 4.2.1
- How to upload multiple images on frontend to ACF gallery using update_field
- How do I sort posts with multiple pages
- WP_Query ordering numbers as letters
- Add user custom fields and make editable on frontend