hope this code will helpful for you
$args = array(
'post_type' =>'event',
'post_status' => 'publish',
'posts_per_page' => -1,
'meta_key' => 'event_date',
'orderby' => 'meta_value_num',
'order' => 'DESC'
);
Related Posts:
- Order Custom post type loop by custom field (datepicker)
- Alter main archive, to show posts with meta as last
- How to query posts by month based on date custom field?
- Problem with revisions only returning four results
- I want to add a custom field in the rss title of each post, but don’t want it to be shown on the site
- Advanced Custom Fields: how do I check to see if a value is set in an field? [closed]
- Advanced Custom Fields – Get custom fields from parent page
- Add custom field to the archive page?
- How to rename a custom field?
- Matching Serialized Arrays with meta_query
- Meta Query with AND & OR?
- Display post_object content using Advanced Custom Fields plugin
- Remove old custom field after import
- Unable to get Preview of Uploaded image within a Custom Meta box
- Change content before writing to database
- Order by Custom Field date not recognized
- Using Custom Function With Advanced Custom Fields
- Plugin similar to Taxonomy Drill-Down for custom fields?
- Unable to show ACF’s Image Custom Field properly in Genesis Framework [closed]
- Login & Register & Custom details WITHOUT plugin
- Sorting posts by custom fields in meta_query
- Upcoming Event: How do I sort database by custom date field, but ignore past dates?
- sort search results by custom fields using dropdown
- WP Custom Fields Metabox Disappears – ACF plugin issue [closed]
- Transfer self made functions.php custom fields to Advanced Custom Fields [closed]
- Conditional custom field query
- Will loading too many ACF Fields cause slow down?
- Display only past events on that page using Visual Composer Grid Bulider
- query usermeta from custom field
- Is there any way to get all meta and standard columns for any WordPress object after searching based on meta key and value
- Get an advanced custom field after post publish
- How to create a dropdown select of all items in an ACF field group
- WooCommerce – Adding Custom Fields To Invoice
- Sort custom post type by multiple custom fields
- Trying to sort and display categories(not posts) by custom field: ‘order’
- Trying to reorder posts by custom field
- Limits, not all post are showen when querying for posts by view count
- Meta query with multiple custom fields for archives page ordering problem
- How to query categories with Advanced Custom Fields?
- Ordering posts by custom field named “date” in backend
- WP Query – Is this correct?
- Advanced Custom Fields WYSIWYG More tag
- Using abs() with custom field in orderby statement
- pre_get_posts : only get posts by wp_usermeta value
- Query post by date (stored custom field meta as yyyymmdd) and differentiate across 12 months
- Custom fields issue [closed]
- Querying posts by latitude and longitude to build a Google Maps with several markers
- List custom queried terms in the edit-tags.php?taxonomy page
- How to copy data from a custom field to the post_content?
- Sortable Custom Columns not sorting correct
- ul list with only as many li’s as filled custom fields
- Display custom field from the front page on another page
- Loop through incrementing custom fields
- Advanced Custom fields not available yet during publish_page action
- How can I output the custom fields wrapping with HTML
- Custom meta boxes in RSS feed
- The conditional logic only works to show or hide?
- ACF Plugin How to make the customer add more fields in the post?
- Order custom fields alphabetically
- How to get custom image field of specific post id
- WP_Query () using taxonomy, custom post types
- Ordering by ‘Title’ OR ‘Custom Field’
- How to query for posts with either one or another custom field
- Get array of posts based on custom field values
- Searching with Multiple (Parallel) Criteria on Custom Fields?
- Compare ACF date field (if exists) and post date and order DESC
- Rewrite comment form post ID on submit
- What am I missing in this Code Block?
- How to show ACF fields in Gridbuilder custom block
- How to set up page fields with gutenberg instead of ACF
- Shortcode for Custom Field of Media Attachment (to use with Featured Images)
- ACF multi taxonomy on filterable gallery
- How to use ACF with javascript to update custom field values?
- Ordering by ACF custom field vaule
- WordPress Admin – Automatically Sort Custom Posts by Custom Field Date Value in d-m-Y Fomat
- wp query multiple values > display a specific value first
- searching by keywords in post’s metas or pagination links problem
- Getting user’s data, by custom field lookup (meta)
- select user with all meta field and field value. I am use Below Query for this ,So any of know another way to fast query instead of below query?
- How to delete attachments associated with custom field type when post property changes? [closed]
- Counting number of images from loop
- Advanced Custom Fields from Category – IF statement
- How to properly get popular Posts by multiple Values
- Display Child Page with custom fields within Parent Page
- WordPress taxonomy child image
- Filter and display a specific custom field value [closed]
- Query Posts Via WordPress URL
- query specific posts according their custom fields, using sql SELECT
- Meta_query not filtering posts
- Get multiple posts with some custom fields efficient
- How to add a prefix to existing custom fields over MYSQL query?
- How to check if custom field exists in this widget query
- Only show content slideshow if “slideshow” custom field exists
- Update field name without losing the value
- Can’t sort custom column on user.php by number / meta_value_num?
- How to get all specific fields from one ACF Group?
- Truncating characters in Advanced Custom Fields works some places but not others?
- Conditional display based on ACF checkbox
- acf field repeater link don’t work
- How to add an ACF only for parent term?