I would store as a custom field, like you say as a timestamp or ISO 8601 (YYYY-MM-DD). That way you can leverage WP_Query’s Custom Field Parameters for queries within your theme files.
For instance:
// Get posts where the custom field is less than the current time
$foo = new WP_Query(array(
// other query vars...
'meta_query' => array(
array(
'key' => 'date_custom_field',
'value' => time(),
'compare' => '<'
)
)
));
Related Posts:
- Paginated Taxonomy Term Archive including one post per term
- wp_query to find posts by year and month
- wp_query check if integer exists in custom field’s array
- WordPress loop: Show only a Custom Post Type Taxononmy TERM
- First custom field value (out of several) displayed twice after query
- How to get_term_meta on single custom post?
- How to display posttypes and taxonomy in standard posts, not in a separate label?
- ACF – Retrieve custom taxonomy from a relationship field
- Display Custom Field or Custom Taxonomy in front page /post/product
- tax_query showing no results
- Exclude a category from WP_Query
- WP_Query orderby custom field then post_date in one query
- get_query_var() not working in pre_get_posts
- query multiple taxonomies
- Filtering a WP_Query meta_query by numeric values isn’t working
- Custom SQL Query on Custom Post Type. Order by Taxonomy?
- WordPress Search documentation: how to improve search query using taxonomy terms, custom meta fields?
- How to select one major category (or custom taxonomy) for a custom post type?
- Sorting a list of posts displayed under a list of associated terms (which should be sorted without initial articles)
- Sort the main query in subcategories/terms?
- Custom Taxonomy List links being re-written
- front end radio custom taxonomy with custom post type
- Get post info inside modal window?
- Want to filter only parent post in admin area
- Custom Taxonomy and tax_query Issue?
- What is better: Custom Fields vs Custom Taxonomies with Terms for perfomance, scalability and better user experience
- Having trouble with custom date field for CPT query (WordPress)
- How to add custom fields to admin UI and REST API response?
- Display posts if a custom field value is equal to another custom field value
- Custom post query by taxonomy
- Separate Posts and Custom Post Type in Custom Taxonomy archive template
- Show Post Count of a Category
- Filtering by Post Meta Custom Fields – Performance
- WP Query—Relationship between two custom post types and their fields
- Group custom posts by custom taxonomy names
- How can i skip same post from taxonomy term?
- WP_Query orderby modified to include custom meta changes
- Returning a list of custom post types excluding those without a specific meta_value
- How to bulk copy custom fields between custom posts?
- Wrong request query on cpt and tax
- Pagination for Custom Taxonomy Page [duplicate]
- Search / Filter posts on Title/Content OR Tags
- Custom loop with multiple taxonomy queries
- What’s the WP way to load remaining custom posts?
- Get Posts by multiple custom fields is not working
- How to have this permalink structure: post_type/postname/custom_inner_page
- Advanced search form with filters for custom taxonomies
- WP the_posts() on single-cars.php get category link
- tax_query not working in template
- Custom Taxonomy Not Showing in Front-End When Outputting a Custom Post Type with WP_Query()
- Custom post type’s extra fields – how to handle?
- Display post from a date range from custom field
- post_per_page ignored in WP_Query
- Creating two loops based on different logic
- Targeting categories in custom fields
- WP_Query parameter conflict
- Custom taxonomies to define versions of a product
- Getting a custom post’s custom field based on another custom post’s custom field select
- How to show all taxonomies within custom post type loop
- Display custom post type for specific user
- Query Posts that have Custom Taxonomy
- List all Custom Post Type posts excluding certain Taxnomy term
- Foreach loop returning more than one item when querying taxonomy
- How to List Custom Post Type Titles Based on Theirs Taxonomy Terms Inside a Nested Loop
- Single.php for Custom Post Type > Taxonomy > Term
- Sorting the Loop by Taxonomy Value
- Ordering by meta value not working
- Create if else for post types in WP_Query ‘post__in’ values
- WP Query from two Custom Post type fields as statement
- Display post count for a specific month
- Custom post type query with taxonomy
- How can I fetch all the dates from custom fields from various different custom post types and show / list them at one place in ascending order?
- WP_Query to display number of custom post type filtered (order by) taxonomy
- Live search by custom tag
- Query a custom taxonomy in a function to create an csv file
- Adding a Section for Visitors
- Display all Custom taxonomy terms and their relevant custom posts
- Need some suggestion/help with custom post types project
- CPT Efficient way to display posts from different categories with custom query
- Query Pulling the same post twice
- Get posts associated with custom taxonomy alternate way
- Use Tags to Query Associated Multiple Posts and Get The Average Of Custom Field Values
- Calling specific page with wp query
- Get list of CPT posts in *current* post’s taxonomy term
- Values inside a custom field to determine which category posts to display
- WP_Query get posts where post_name is empty
- How to display elements of different post types?
- WP Query WordPress Post Type with the same Taxonomy name
- How to list groupings and keep pagination
- How to retrieve taxonomy terms of the current custom post?
- Advanced search form with filters for custom taxonomies and custom fields
- Query recent posts by author
- Listing all custom post types using a specific term on the said term’s template page, in groups
- Querying meta values within an array
- How to Get The Taxonomy Term in Custom Post Type Loop Inside a Wp Query
- Filter Custom post type by another Custom post type
- display custom post type from register taxonomy
- How to change order of custom post types. I want Featured post to come first
- WP Query + custom fields: How to query event posts from the current date backwards 6 months and organize it month by month?
- Query custom post type and group by taxonomy