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 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
- Search and replace text across all posts
- How to store ACF custom fields data in a custom table
- 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
- 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
- Loop with array of posts using ‘Advanced Custom Fields’ plugin [closed]
- wordpress in nginx docker container connected to php:8-fpm container and mariadb container isn’t creating any tables on plugin activation
- Advanced Custom Fields/User Role Editor – how to hide ACF for certain users?
- Last modified field for user profile?
- How to determine what is generating large amount of database queries?
- mysqli_error() expects parameter 1 to be mysqli, null given in own db class
- Getting value from Advanced Custom Fields [closed]
- How can you include a theme template file from within a plugin (i.e. WooCommerce’s Shop page)?
- Advanced Custom Fields plugin – get text from editor field and save it in a variable
- Display data on Word Press site posts and pages from mysql table
- Pull out Advanced Custom Fields in Related post plugin
- Help With MySQL to WPDB Query Conversion
- Using a post-signup hook to get user details
- Matching Chapters to a Custom posts [closed]
- Custom Fields with Pods not being translated
- get current date + 90 days and checking every day
- join 2 table orders wordpress plugin
- is there a way to link one of the field in ACF field group, to a field in a media attachment page? [closed]
- How can I perform high-level database merging for WordPress within continues delivery?
- 306 MB of wp_options occupied by WordPress SEO Plugin, is that normal? [closed]
- Enabling WP_USE_EXT_MYSQL to support old plugin
- how to access all user dashboard on fronted page [closed]
- WordPress + JavaScipt + AJAX + MySQL: insert query for form
- SQL to order by CPT results by user->display_name w/only user->ID known
- Enabling plugin failed because MySQL user do not have CREATE permissions
- dirname( __FILE__) returning wrong directory inside plugin
- Better ads plugin has 500.000 entries in wp_postmeta
- Paid Membership Pro with ACF [closed]
- ACF only showing up in Homepage but doesn’t appears in all pages
- pagination on data fetched using SQL query
- after wordpress update to 3.5+ i get many errors in plugin wpdb::prepare()
- Speeding SQL queries for a large database?
- Cannot get wpdb data (Error in a simple fuction) [closed]
- Notice: Uninitialized string offset: 0 in social sharing mu-plugin
- Using ‘mysqli_connect’ ‘crashes’ WordPress client-side
- Remove Advanced Custom Fields plugin for client?
- Always get creating a new table with foreign key
- How do we update a custom file upload field with the Advanced Custom Field plugin?
- DB Query not working in Plugin
- Advanced Custom Fields (acf) – Filter Relationship by Taxonomies not Post Type
- Comment Approve – Add custom function when comment is approved
- Conditional custom redirect
- How to display a number of posts based on a Advanced Custom Field (ACF)
- WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version [closed]
- How to get the get the select values created by ACF plugin in wordpress
- Can’t create tables with my plugin
- Check against server time to display SQL entries – Radio Station DJ Rotator Plugin
- WordPress Cache delete on plugin uninstall
- How to create repeater field manually, without plugin (ACF Pro)?
- need to find duplicated meta value in custom filed and view the posts that have the same value
- JOIN and SUM different statement results (Mailster Database)
- My CPU usage in A2 Hosting Shared Plan (Turbo Boost) is high due to mysql query!
- Setting Author on CPT
- What database state changes happen after a post is manually “updated” with no changes?
- WP Function does not trigger on Webhook API Call
- ACF checkbox return format based on page
- How to get database connection details without longing to cpanel in WordPress?
- Performing CRUD operations on front end in wordpress
- custom fields not displaying on wordpress site
- Display a number value from mysql query in WP
- ACF Fields are not showing up on Homepage
- Why Custom fields description is not working WordPress Version 5.4.2?
- Store GravityForm data in phpmyadmin (mysql)
- Change the color of ACF Subtitle output background
- Login issue in WordPress
- Get only selected custom taxonomy
- ACF Taxonomy search on backend (Relationship field)
- get/show Last ID
- plugin_dir_url(__FILE__) searches parent theme in ACF extension
- HyperDB failover Delay
- Resetting AUTO_INCREMENT primary key
- Create Database Tables on Plugin Activation hook
- Slow WordPress admin panel with a total query time of 1664ms
- Advanced Custom Field User Help URL
- Define constant for one plugin in mu-plugin
- Pulling Advanced Custom Fields from other pages
- Custom time field won’t sort regardless of format
- ACF Taxonomy Object term Null [closed]
- How to display blog posts only authored by the administrator
- 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
- PHP Creating a formula from mysql db values and db stored math operator
- 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