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
- Tips for using WordPress as a CMS? [closed]
- Custom Post Type Templates from Plugin Folder?
- How to Remove Certain Screen Options and Meta Boxes from add/edit post type?
- How can i force Display names to be the same as Usernames?
- Adding Custom Fields for Img in Posts
- Edit Imported advanced Custom Fields from wordpress Dashboard
- How to make a list of companies’ information and display them to user, using custom post types and a custom taxonomy?
- [Plugin: Posts 2 Posts] reciprocal connections
- Star rating for custom post types [closed]
- How to Make a Custom Grid View
- Custom options page checkbox will not save, despite working with text
- Upload files programmatically to users
- Way to hook into a sidebar call to replace it with a custom sidebar
- Plugin not saving values when placed in a folder within /wp-content/plugins
- Security checking in meta_box save is reluctant?
- wordpress reusable content blocks
- 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
- UnWanted Custom field added in the wp page edit area
- How to query the custom fields by language?
- Plugin custom post type – Internal server Error
- Is it possible to create Custom Post plug-in?
- List taxonomy terms for post as checkboxes
- Tracking changes in admin-page so user gets warning when leaving the page
- Mq translate plugin custom post type issue
- Char limit on custom blog-post form? [closed]
- Custom fields for custom post type
- What is the best way for showing a grid of customer logos?
- Adding class to last list item? Not WP generated
- How to use template_include hook with form submission?
- Trying to add a page template for my custom post type from a plugin, but it will not display in the template dropdown unless file is in theme
- Custom Post Type – custom form in dashboard
- $pages = get_pages(‘child_of=’.$post->ID); Why arguments are concatenated?
- Modify Posts from Custom_Post_Type within the plugin
- Custom post types, disable fields
- WP-API Custom Post Type json_no_route
- How can I list custom post type categories of portfolio
- Plugin generated unexpected output – No PHP errors
- “Allowed memory size” problem [closed]
- Including content from legacy app: via plugin or custom content?
- Problem with date comparison for custom fields
- Adding custom Field To The Posts Listing
- Error Metabox Warning: call_user_func() expects parameter 1 to be a valid callback
- Table of contents (TOC) plugin is not showing header tag
- Best approach to make all tags searchable by the wordpress search function
- Setting Author on CPT
- Create category for each user
- custom post type plugin error [closed]
- get_post_meta shortcode returns empty field
- Merging new theme and plugins from development site to production
- Why Custom fields description is not working WordPress Version 5.4.2?
- Problem Advanced Custom Fields PRO
- Is it possible to customize a wordpress post from outside dashboard(Something like site.com/post-type/post/?e=post_id)?
- Custom product page’s style for printing
- WordPress doesn’t save a post revision when changing CMB2 custom fields
- How to Save settings of custom tab product page in admin side in a database?
- Custom Fields as Post Type Options
- How to get past and upcoming post by defining date in custom field?
- Calling an custom field from theme option at the frontend
- Creating themes using the one Plugin (Toolkit)
- How to add jquery to my custom post type wp plugin
- WordPress list child pages of custom post type
- WP_Query Date Filtering Inclusive Being Ignored
- WordPress Custom post type won’t save properly
- force category table refresh when adding new category
- Extending a CPT by Created by another plugin
- get_post_meta does not work
- Woocommerce custom fields
- Remove base from the custom post type URL [duplicate]
- ACF: Not displaying ACF data from another post
- Order shipped by which driver[hook for woocoomerce order staus changed and popup in admin panel ] [closed]
- Wrong block appender button showing
- Select posts from list and add them in a new list
- What is the easiest way to create a custom field archive?