Direct SQL functions like str_to_time won’t work within the value field of metaqueries. You need to provide actual date values. To compare between today and the next 7 days, you will need to calculate those dates and then use them in your query.
print your query in jet filter
// Get today's date
$today = date('Y-m-d');
// Calculate the date for 7 days from now
$next_week = date('Y-m-d', strtotime('+7 days'));
// Meta query to compare between today and next 7 days
$date_query = array(
'key' => 'your_date_meta_key',
'value' => array( $today, $next_week ),
'compare' => 'BETWEEN',
'type' => 'DATE',
);
// Your query arguments
$args = array(
'post_type' => 'your_post_type',
'meta_query' => array(
$date_query,
),
);
// Run your WP_Query with these arguments
$query = new WP_Query( $args );
Related Posts:
- add_meta_box Callback not being called
- Plugin allowing for artists, events and venues
- how do i remove posts from a WP_Query so the pagination is right?
- Saving Custom Post types and fields to a custom table
- Creating a custom post type, adding custom meta fields, preventing all future editability of posts of this type
- auto populate list of questions if user select a category xyz
- Redirect to another page using contact form 7? [closed]
- Custom Post Type Fields
- How to Resize the Custom Post Images?
- Amazon.com intergration with WordPress?
- Sticky option for custom post types without using custom fields or plugins
- How do we update a custom file upload field with the Advanced Custom Field plugin?
- Price comparison table based on Custom Post Type?
- Show related posts based of current ACF field name in a single page post (a loop within loop)
- How can I store data from custom fields to custom tables?
- “After file loaded” action
- Dictionary-style definition list plugin
- How to create repeater field manually, without plugin (ACF Pro)?
- Register PODS Custom Field with WPGraphQL [closed]
- WordPress hide post from custom post-type on a single page
- Create multiple posts when a custom post is created
- What method should I use for a sidebar widget that reads latest posts?
- Synch Custom Post Types (and Custom Fields, Cats, etc.) Between WordPress Sites
- How can i do custom author list?
- A plugin for software reviews site like this one?
- Links not opening as they should. Custom WP plugin
- wordpress reusable content blocks
- Override plugin with functions.php
- Make the checkbox meta field checked by default
- Last modified field for user profile?
- Should i delete the posts created by a plugin on uninstall?
- Allow users mark posts as “complete”?
- WordPress CMB2 – Run function on save
- FacetWP group listings by custom field [closed]
- Is there a way to order posts and custom post types as one group?
- RW Meta Box ,Problem setting post title
- How does WP handle multiple matching rewrite rules?
- dynamically generating plugin syntax
- Is it possible to use WordPress as an online portfolio for text content? What kind of theme would I look for?
- Building a store locator with google maps
- Custom Field Template seriously messed up in WP 3.1.1
- Duplicate posts when posting nulls in records in phpMyAdmin [closed]
- How to make wp_enqueue_style and wp_enqueue_script work only on custom post type
- Loco Translate: Custom Post and Custom Taxonomy Labels not translated in wp-admin menu
- Accessing post’s meta data based on user’s click of a post
- Carbon Fields use in custom plugin class
- How I can get custom field’s current value?
- UnWanted Custom field added in the wp page edit area
- Woocommerce – How to populate custom select field with stored values on checkout page?
- Replace text in post from cvs
- Implement Autocomplete for a custom field on WordPress Plugin Frontend
- How to create user groups and allow custom posts and plugin modify/access to specific group?
- Correct way to make meta box with more than one meta field secure
- I want to extend the current themes’ single.php to display the meta fields of my CPT
- How to query the custom fields by language?
- Plugin custom post type – Internal server Error
- Exclude post by custom meta with pre_get_posts
- How can I create a custom shortcode that will return a custom post type by ID?
- Is it possible to create Custom Post plug-in?
- get_post_type() and WP_QUERY issue
- Date calculations from 2 custom fields
- get_post_type on post.php
- List taxonomy terms for post as checkboxes
- All of my custom posttypes are 404’ing
- more types plugin – display all post of post type on page
- When using Simple Fields plugin, how do I pull the information out of the database to display on a page?
- How to make a proper custom post type link
- Assign / update custom field value for all posts (How can I assign only to posts without custom field value?)
- Matching Chapters to a Custom posts [closed]
- Custom post type – no layout section of Document tab, and no author choice
- ‘No Results Found’ on single post for custom post type
- Keep a post copy when this one is updated – issue
- Making a Template for a CPT created by a plugin
- how to add a button next to the wordpress view button?
- is there a way to link one of the field in ACF field group, to a field in a media attachment page? [closed]
- How to toggle between two custom fields in WordPress woocommerce ‘WC Product Field Group’ plugin?
- How to create an input field, and base the output on spreadsheet data? [closed]
- Dynamic dropdown select values depending on other custom field value
- Tracking changes in admin-page so user gets warning when leaving the page
- How do I hide posts across all loops based on the value of a custom field?
- Meta Query posts not showing on ending date of custom field
- Custom User meta field display
- Mq translate plugin custom post type issue
- “Custom Post Type Permalinks” plugin URL strcuture
- Unable to delete custom post types, confusion around capabilities
- Execute js files doesn’t seem to work
- WordPress metaboxes – textfield suggestion automatically populated
- Char limit on custom blog-post form? [closed]
- Unable to select image using custom image field type
- Adding CSS to custom post type admin page causes error
- Custom fields for custom post type
- ACF: post query, hide duplicate values [closed]
- Every new post/draft has a custom field variable “yst_is_cornerstone” showing
- What is the best way for showing a grid of customer logos?
- How to delete all trashed item in one-go
- How do I enforce users to fill a determined custom field using WyPiekacz?
- How can I use a file in my plugin as a replacement for single.php on custom-post-type query?
- Custom setup of wordpress comments that are displayed
- publish_post action doesn’t work
- Disable Individual Plugins (specifically in Custom Post Types) on a per-post basis?