I’ve modified your existing code.Can you please try the code bellow:
$args = array (
'post_type' => 'exhibitions',
'meta_query'=> array(
'relation' => 'AND',
array(
'key' => 'exhibition_status',
'value' => 'past',
),
array(
'key' => 'end_date',
'compare' => 'EXISTS',
'type' => 'DATE'
),
),
'meta_key' => 'end_date',
'orderby' => 'meta_value',
'order' => 'ASC',
'post_status' => 'publish',
'posts_per_page' => 10,
'paged' => get_query_var( 'paged' ),
);
Related Posts:
- ACF Relationship Field Search Filtering [closed]
- ACF datepicker meta_query Compare Dates in m/d/Y g:i a – Not in Ymd Format
- meta_query with array as value
- If two first numbers exist in wp_meta_query value
- WP_Query meta_query >= date
- Custom query based on meta key – Reduce three states to two in results?
- What is the random string I am seeing when I use get_query_var?
- Any number in meta key (wp query)
- WP_Query with meta_query dosen’t return results
- Custom query filter by ACF date custom field
- Order WP_Query by meta_key priority when ‘OR’ relation used for multiple meta values
- ACF: How to query for a given value count of an array like field? (e.g.: How many rows has a `flexible_content` field?)
- WP_Query, ACF field and array
- Pre get posts sort by meta key returns no results if meta key does not exist
- Slow wp_posts and wp_postmeta query using Advance Custom Fields
- Get posts meta_query by repater field
- How can I modify standard search query to include also ACF custom fields values?
- The sorting of posts by a meta_query with two keys fails while separated as single queries it works
- Get posts using multiple values from ACF checkbox as meta query wordpress
- How do I subquery with custom meta fields?
- Use value from meta key array for use in WP_Query
- How to use meta_query to retrieve posts from multiple custom post type
- WP_Query filtering in ACF field containing dates
- Meta query with string starting like pattern
- how to show posts that are missing a meta_value
- Changing the meta_query of the main query based on custom query_vars and using pre_get_posts
- WP_Query using meta_query with relation OR and orderby meta_value doesn’t work
- querying with custom meta field with meta_query
- Order by two meta keys
- multiple meta key but get server load is very high
- A WP_Query that will look for posts after 2 weeks ago OR with a certain meta value
- Order by meta_value_num DESC and meta_value ASC on WP 4.0
- WordPress altering my custom query, How to fix it?
- Order by meta_key in custom post type doesn’t affect the query
- Use meta_query to display events by date in custom field
- Minimising number of queries on a page when using Advanced Custom Fields
- How to show recent and upcoming birthdays using meta_query
- Order Posts by meta value AND published date
- ACF Relationship + WP Template Parts
- Using WP_Query and WP_Meta_Query Outside of WordPress
- WP_Query on custom field and order results
- Fetch Record based on meta key dates
- meta_query in WP_Query value is not accepting array
- Is there a way to work with a specific the_field from an already queried post? [closed]
- Changing sort order for presentation by Jetpack infinite scroll
- meta_query not working as expected
- get posts by meta_key from inside key of post meta
- Help optimizing slow WP_Query with meta_query
- meta_value_num not ordering all items
- Meta Queries – should nesting work after WP 4.1?
- Filter and Order by Multiple Custom Meta Values
- Meta Query relation “AND” then set array accordingly
- 2 weeks ago from meta query meta value
- Is it possible to query a custom field where the value is between two fields?
- How to provide meta_key array to wp_query?
- filter wp_query result with custom field values
- How to set up hierarchical relationships without using plugins / meta query
- Meta query compare for ID’s greater than specific ID
- Is it possible to add relation between meta_query and tax_query?
- Get a list of ACF Repeater-Fields as array
- Show single posts date, in a page of posts
- WP_Query Class custom field parameters
- meta_query where the meta value is not the post title
- Multi-layered WP_Query
- Oxygen Repeater Advanced Query
- WP_Query for distinct meta values
- Group Product Types
- WPQuery Date and ACF
- meta_query with meta values as serialize arrays
- WP Query – grouping posts by same meta key, adding together values from another key
- Woocommerce Get Orders By Meta Value
- meta_query is overriding default search
- Multiple WP_Query args combinations according to post type
- WP Query by variable custom field
- WP_Query multiple value not working
- Query for current post
- WP_User_Query Orderby Not Working
- Unusual high query of user meta data
- WordPress Query optimaization for slow query
- How to query wordpress with array of meta_values?
- Meta query doesn’t remove placeholder escape before query
- WP Query Meta Query
- Query custom meta value – post view and date meta
- What is the best way to reset a search on a meta_key / meta_value?
- Custom WP_query and integrating into theme file
- WP_Query – show posts where meta value and user_email match
- Best way to Order Post in Home without a plugin
- WP_Query using meta_query with LIKE doesn’t return what it should
- Is there any difference between below WP_Query code snippets?
- Geo location query inside wp_query?
- Return a single custom post from multiple meta queries
- query post based on comparison
- Including ‘cat’ => $cat breaks meta_query
- meta_query compare not doing what I want it to do
- Query string form $_GET[‘value’] is not working as meta value in wp_query
- 294 Queries on Mainpage of WordPress
- How to get all post_id and meta_value using meta_key in wp_postmeta table
- WP Query – Show custom posts only if user contain some user meta
- Showing Counts on Comment List with Custom Query
- How to get products with the same custom attribute like ean code