You should be able to order your posts by adding the following to your main args:
'meta_key' => 'date',
'orderby' => 'meta_value_num',
'order' => 'ASC',
Example:
$args_post = array (
'post_type' => 'post',
'posts_per_page' => -1,
'fields' => 'ids',
'meta_key' => 'date',
'orderby' => 'meta_value_num',
'order' => 'ASC',
'tax_query' => array(
array(
'taxonomy' => 'tipo-de-contenido',
'terms' => 'actividades-y-talleres',
'field' => 'slug',
'operator' => 'IN'
)
),
);
You mentioned in your question that the field is named “acf date”, in my code I’m assuming the field name is actually just “date” as the former wouldn’t make much sense. If that’s not the case be sure to change ‘date’ to your actual field name.
Related Posts:
- Using meta query (‘meta_query’) with a search query (‘s’)
- ORDER BY custom field value
- Can I query custom meta data through WP_Query
- Add custom fields to search
- SELECT max(meta_value) FROM wp_postmeta WHERE meta_key=’price’… stops working when value is over 999
- Matching Serialized Arrays with meta_query
- Meta Query with AND & OR?
- Trying to perform complex custom field query with order by set to field value
- Is there a way to do multiple ordering on a multiple meta_query?
- WordPress Search Custom Meta Field Only
- Compare meta_query decimals not working right
- Ordering posts by anniversary using only day and month
- Calling Specific Pages with wp query Part II
- Loop through two different sets of custom fields
- Slow meta query with multi meta keys
- Using OR in WP_Query negates the “NOT EXISTS” compare
- How can I query on the year part of a complete date in a custom field?
- How can I combine meta_query queries?
- Displaying posts with only upcoming dates according their custom field date value
- Difference between ‘LIKE’ and ‘IN’ in meta queries
- Sorting posts by multiple values, combined
- meta_value_num sort glitch
- WP_Query display next custom post from today’s date
- Which is best in the following scenario : post_meta vs custom table vs parent/child posts
- WP_Meta_Query causing long-running MySQL queries
- Sorting posts by custom fields in meta_query
- meta_query for a string inside a meta field containing a comma-separated list
- Order by custom field value not working for acf date field
- Complex WP_User_Query call fails on production server
- Meta query with timestamp using WP_query
- Orderby custom field meta value ASC and then by date DESC
- How make a custom search on backend in WordPress without plugin?
- How to add a new meta key and assign timestamp to posts
- Get content from pages with same meta_key from Database
- WP 3.1 meta_query for multiple custom field values
- How do I have WP_Query match posts based on search parameter OR meta fields? (rather than search parameters AND meta fields)?
- Get posts with same meta value as current post
- Alter main archive, to show posts with meta as last
- Meta Query returns wrong number of posts
- Change order of posts
- Meta Query And/Or
- Use meta_query to get title of associated post
- Meta query with multiple custom fields for archives page ordering problem
- filter custom field values $min $max
- Ordering posts by custom field named “date” in backend
- Get Data From wp_sitemeta for Multisite network
- Unique meta_key with array value vs repeated meta_key with single values
- get posts where a custom field contains a text
- WP Query – Is this correct?
- How can I do a variable for meta_query?
- Avoiding ACF get_field and returning to core WordPress function
- ORDER BY custom field value out of where clause
- comment meta_query for keys that aren’t yet set
- Query post by date (stored custom field meta as yyyymmdd) and differentiate across 12 months
- ACF: How to get users with a ACF flexible content subfield with a specific value AND layout?
- change order of images attached to post
- Meta_query ‘compare’ => ‘LIKE’ not working?
- Diamond question mark in text after migrating content
- tax query between operator like
- Best way to sort estates and query them (for rent? yes/no. contains office space? yes/no)?
- Is it possible to compare the current time with a custom “start” and “end date
- How can I modify my meta_query to work with prices that are stored in the database that contain dollar signs and commas?
- Need to search a custom field (ingredients, one long string per post), but want it to allow phrases/non-exact matches
- Making WP_Query limit results by date before today where date is a meta_query
- multiple meta_query and orderby question
- get posts based on non-single metadata
- Woocommerce products search with custom fields
- How to save multiple values with same meta_key, each value linked to another tag id
- How to improve my non-unique metadata MySQL entries?
- WP meta_query args not working in function
- Filtering posts by ACF meta query
- Why does my numeric meta query work only on one meta key and not the other?
- meta_query to check all custom fields
- Query multiple meta values at the same time :
- Create Shortcode shows only posts with custom_field meta
- meta_query ‘compare’ => ‘!=’ not working
- Create custom query for search?
- Filter query based on date in custom field
- Query Posts Via WordPress URL
- Meta_query not filtering posts
- Checking if field is set before comparing with meta_query in query_posts?
- How do delete a meta key?
- Filter Query Post by Custom Fields(by date)
- Dynamic background image used in css after selector
- WP Query Args – search by meta_key or title
- SQL query based on two different custom field values
- display specific custom fields
- Title and post URL based on custom fields?
- Multiple relationships in a query
- meta fields for the whole wordpress site
- WordPress creates new lines in postmeta table on post update
- How to add custom filed value after in wp post title
- How to Pass values to Custom Field through PHP in WordPress Posts?
- Only admin should be able to add a particular custom field
- Custom date column in user table not sorting correcting
- Custom Fields displaying in single line
- Change path to child of page when uploading image via custom field
- Meta Box Data added to header redirect
- Using CMB2 Plugin to create text_date metabox (datepicker) How do I save multiple dates? [closed]
- price calculation from custom field (woocommerce) [closed]