So what you need to do is order it by the custom value of the meta_key date value.
Something like this (untested):
$wp_query = new WP_Query( array(
'post_type' => 'upcoming_events',
'order' => 'ASC',
'meta_query' => array (
array (
'key' => 'your_custom_date_key',
'value' => date('Y-m-d')
)
),
'orderby' => 'meta_value'
)
);
Hope that helps.
Related Posts:
- Unable to check if plugin is active
- Creating 20,000 Posts or Pages using a .csv file?
- How to properly insert data into custom table via plugin
- How to get current post ID in Contact Form 7 wpcf7_before_send_mail hook action
- How does WordPress handle MySQL row lock errors?
- Using Advanced Custom Fields with WordPress and Lightbox
- Searching users with WP_List_Table plugin
- Search and replace text across all posts
- Convert WordPress posts to products in WooCommerce
- How to store ACF custom fields data in a custom table
- Can I explicitly specify ENGINE=InnoDB in WordPress?
- Generate Advanced Custom Fields box in custom admin menu page
- Bad Request (Invalid Hostname) on working server, database problem
- Edit Imported advanced Custom Fields from wordpress Dashboard
- How can I list only sites that use a particular theme or plugin?
- Visual Composer vs. Advanced Custom Fields [closed]
- ACF for audio url in wordpress audio shortcode
- Help!! I Screwed up my WP
- $wpdb->get_results() does not fetch results with unicode ‘WHERE’ clause
- Custom field in TWIG template – Advanced custom fields plugin
- Changing BIGINT to INT
- Advanced Custom Fields query
- How do I add advanced custom fields / meta fields to Elasticsearch? [closed]
- Replace existing pages with new pages, keep menu links
- How to create Repeater fields using Advanced Custom Fields?
- Can I run multiple queries with $wpdb->prepare?
- Loop with array of posts using ‘Advanced Custom Fields’ plugin [closed]
- Using ACF to display data on all pages
- How to remove duplicate Custom Fields?
- wordpress in nginx docker container connected to php:8-fpm container and mariadb container isn’t creating any tables on plugin activation
- greatest() function returns undefined property
- Advanced Custom Fields/User Role Editor – how to hide ACF for certain users?
- How to write one comment and publish on every post using database or plugin?
- Last modified field for user profile?
- WP_Query ordering numbers as letters
- How to get number of Affected rows from wordpress dbDelta() function
- How to determine what is generating large amount of database queries?
- MySql database help for a plugin
- How to remove Database Table in WordPress via Function file?
- mysqli_error() expects parameter 1 to be mysqli, null given in own db class
- Bulk edit existing shortcode within custom field
- Getting value from Advanced Custom Fields [closed]
- ACF Query result in a new td (echo)
- Delete user meta based on key value that is an array
- Get only selected custom taxonomy
- ACF Taxonomy search on backend (Relationship field)
- Get a Taxonomy values in an array
- Else If statement for ACF [closed]
- get/show Last ID
- plugin_dir_url(__FILE__) searches parent theme in ACF extension
- HyperDB failover Delay
- Resetting AUTO_INCREMENT primary key
- Re-writing MySQl query for execute faster
- Create Database Tables on Plugin Activation hook
- Write mysql credentials in plugin
- Help with sorting and storing data on WordPress
- Slow WordPress admin panel with a total query time of 1664ms
- Linking Plugin Files to WP
- How to use categories in the URL with Advanced Custom Fields?
- MySql Query for WordPress
- Advanced Custom Field User Help URL
- Define constant for one plugin in mu-plugin
- Hide/Show panel not showing – ACF
- Pulling Advanced Custom Fields from other pages
- Using wp config to connect to a DB from a plugin
- ACF: Hide a div or template section when a custom field (in a field group) is empty
- Custom time field won’t sort regardless of format
- How ACF Advanced Custom Field works with Woocommerce Single Product [closed]
- ACF Taxonomy Object term Null [closed]
- how to search through plugin in wordpress cimy-user-extra-fields?
- Get all the related data from WordPress DB
- How to display blog posts only authored by the administrator
- Trying to insert a row from a Plugin
- 504/502 errors plauging our site
- how to show the data from a myqsl database in a post [closed]
- Post sorting and ordering function in WordPress Admin is broken and always shows post from oldest to newest
- How can I delete the options from DB when the plugin is deleted?
- PHP Creating a formula from mysql db values and db stored math operator
- Update acf field in woocommerce orders
- Share or sync user table data with another user table
- True/False ACF field returning null by default even if default value is true
- Sort posts by Date (DESC) and by ACF: active_inactive (ASC)
- Split Million WordPress Post’s Into Multiple Database Server
- ACF prugin for WooCommerce Shop Page
- Getting 504 Gateway Timeout Error on AWS Server! [closed]
- WordPress issue – data is not showing in wp-admin, but when searching through database, all the data is there
- Using ACF to allow user to add and edit multiple saved forms
- Advanced Custom Fields (ACF) and their Javascript API
- Remove posts that start with similar words (like a delete duplicate posts plugin)
- WP_Query does not return the result even if the data is present in the database
- Not applying update field (acf) in my plugin
- Plugin question, How to insert a colon in a value box
- Updating wp_postmeta from meta_keys and meta_values from another table having price and sku only
- Import posts from a different database with the same old id
- WP Plugin: How to avoid db access for each comment?
- PHP Fatal error: Cannot redeclare distance() when making a new block
- Saving Tutor LMS plugin courses as WordPress Blog Posts in Database [closed]
- Draft standard post by ACF Data picker
- Lets simple destroys website
- Query Custom Post Types on Available Dates