The only built in way ( using a function) is to use WP Query
and the custom field parameters, specifically meta_query
and compare
.
http://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters
An example to get you started:
$query = new WP_Query( array( 'meta_key' => 'your_date', 'meta_compare' => '=' ) );
Alternatively, the custom field functions in WordPress do not have many parameters, they are basically for adding and retrieving data, which you can then use with native PHP, for instance you can return the custom field as an array using something like:
$meta_date_array = get_post_meta($post_id, $key, false);
ksort($meta_date_array);
and use PHP’s ksort
to sort the order.
Related Posts:
- Ordering posts by anniversary using only day and month
- Displaying posts with only upcoming dates according their custom field date value
- Ordering posts by custom field named “date” in backend
- Can I exclude a post by meta key using pre_get_posts function?
- What is the index [0] for on post meta fields?
- Custom field metabox not showing in back-end
- So much data in postmeta
- How to hide meta box values from custom fields list?
- get_post_meta() unserialize issue – returns boolean(false)
- What is the advantage of the wp_options design pattern?
- Meta keywords and descriptions plugin for manually editing meta for each page/post
- Transients vs CRON +Custom Fields: Caching Data Per Post
- Unable to save datetime custom meta field using update_post_meta() function
- Up/Down voting system for WordPress
- post meta data clearing on autosave
- Create custom field on post draft or publish?
- Display info from custom fields in all images’ HTML
- get_post_meta fields don’t show up on posts page
- Update meta values with AJAX
- Localized Date Format for Custom Field
- copy attachments to another post type and change attachment url
- Cannot edit post meta fields with rest API
- Add a post meta key and value only if it does not exist on the post
- Custom fields to save multiple values
- Function to change meta value in database for each post
- Get aggregate list of all custom fields for entire blog
- wp_handle_upload error “Specified file failed upload test” but still creates attachment?
- Which is best in the following scenario : post_meta vs custom table vs parent/child posts
- Saving custom image meta fields
- Get all meta keys assigned to a post type
- Adding custom fields (post meta) before/during wp_insert_post()
- How to query posts with certain custom meta data, and output Post data
- MySQL Query that looks for post with Custom Field, then changes Category
- ACF: How to get the full field name (meta_key) by a field key?
- post meta getting deleted on save
- Custom field not updating when value is empty
- meta_compare seems to be treating values as strings instead of integers as expected
- Limit the number of acf content when displaying in post loop [closed]
- How to add custom metadata text box dropdown to sidebar in Gutenberg editor for all post types
- Add post meta fields, when creating a post using WordPress’ REST API
- Store array as single, serialized post meta field or many post meta fields?
- Custom Field Values not updating unless I click “Update” twice
- update_post_meta for repeated custom field [closed]
- Trying to update_post_meta function
- Displaying multiple URLs as custom field values
- Show values of custom post meta on ‘Add new post’ page?
- Custom post meta field effect on the performance on the post
- get_posts in meta box dropdown not showing latest posts
- Limits, not all post are showen when querying for posts by view count
- Display Custom Meta Box Field Only If Value is Present
- Stop sending email everytime I updates my post
- Best way to store everyday post views?
- Unable to get specific value from post meta
- Custom meta is not being saved
- Query post by date (stored custom field meta as yyyymmdd) and differentiate across 12 months
- IF Custom field value equals ZERO
- How to use media upload on metabox post page without breaking TinyMCE?
- Branch made by several custom values
- Looping inside block return
- change order of images attached to post
- User customising position of WordPress Featured Image
- how can I show name and value of Custom Fields together?
- Can I save post meta programatically without setting metaboxes?
- Insert image into sub-field with update_post_meta
- How to use conditional statement with custom field
- Meta box values are displayed on Custom Fields list. Is it possible to hide them?
- Gravity Forms Update post meta from template [closed]
- Best way to achieve multiple links in a post title
- How can I add/update post meta in a admin menu page?
- How show post only from after custom date
- Get author total post votes from post meta
- custom filed from post in the side bar
- Meta field bulk editing no longer working in WP 6.0 [closed]
- How to display custom fields in hestia theme
- How to speed up post list slowed by update_meta_cache()?
- WordPress Blocks, setAttributes not saving
- SQL query to change the value of a Custom Field
- Custom meta POST request fired twice when updating a post in Gutenberg
- Add custom field information to source meta data
- Update custom field on page specific to logged in user
- Save, update, get and sanitize post meta as HTML not plain
- Create Meta boxes dynamically
- Saved Post Meta Array Returns as String
- Delete custom meta
- Check if value exists before saving
- Get meta value when the page is a blog archive
- Thirtieth century date for a post
- change attachment custom field onChange event
- wordpress simple post multi rating with post_meta and user_meta
- wp_postmeta are updated for only one page
- Complex WP_Query Using Post Date And Post Meta
- Custom fields / meta box output
- Make Custom Fields Public in JSON – API
- Colecting values from custom field checkboxes and displaying them in the post
- Build Array from Input Fields question
- How can i put a custom field inside this php
- Dynamically update Custom Fields to display new dates
- save all acf options in one meta_value [closed]
- WP Query Args – search by meta_key or title
- Search for meta_query does not return any result if combined with title