Here is the working solution:
add_action( 'elementor/query/my-custom-query', function( $query ) {
$meta_query = $query->get( 'meta_query' );
$query->set( 'date_query', array(
array(
'after' => date('l, F jS, Y', strtotime('+0 day')),
)
) );
} );
You can change the strtotime (+1 day….+n day ….-n day) to fetch the event’s date you’re looking for.
The date format here is (‘l, F jS, Y’), you may change based on your WordPress setting (Dashboard >setting >General)
Elementor query id: my-custom-query
Related Posts:
- Possible to filter the posts or categories that XML-RPC users see in their mobile application?
- Filter custom post types in archive
- Filter Posts by current Month
- Is it possible to apply filter to meta key value when querying posts?
- Want to use wp_get_current_user() in query filter
- Excluding posts by meta, and also keeping posts without the meta
- Customising the default wordpress search functionality
- WP_Query filter by custom meta
- List all categories that have results in a query
- Having issue with dynamic data within restrict_manage_posts function
- Displaying posts on a page that have been assigned a value in a database
- Add option to query string before get_posts() is called on archive.php
- Filter on the day of the week from timestamp
- Admin view: filter posts by whether they have specific taxonomy attached
- Restrict access to custom post type and filter from every query
- Adding an orderby filter, casting postmeta with multiple keys
- Query Multiple Filters, one with Meta
- How to pass/get data to/from the WooCommerce data-product_variations object?
- Prevent 404 when using pre_get_posts to filter an archive page
- Hook added to the_content seems to be called multiple times
- Translating an error message
- Display WooCommerce newest product reviews on top [closed]
- Overriding wp_get_archives() apply_filters()
- How to make post and comment count unclickable with dashboard_glance_items hook
- Call to undefined function error after adding add_filter to wp-config
- How can I hide all posts that don’t have a thumbnail?
- Filter Media Library by author or post_parent
- Add Dropdown menu using “add_filter => wp_nav_menu_items”
- Restrict filter to run only inside specific function
- How to add a custom filter in functions.php
- How do I add a current class to the current post?
- How apply_filters work in WordPress?
- Apply a filter only once
- What functions are included in apply_filter(‘the_content’)
- Add a header before fields added with the attachment_fields_to_edit() filter
- Are there Limitations on filter handles?
- Hide content editor for posts after approriate date
- Buddypress: Edit activity when new blog post [closed]
- How to make a button?
- What is considered a default query for the request filter?
- Same Conditionals Not Working on Two Different Hooks
- Filter get_template_part() $args array
- Modify a Filters Second Parameter
- Variables in post title
- How to edit dashboard search posts button texts for my CPT?
- Insert term when page is published – avoid duplicates after edits
- Filter Media by Featured on Admin
- Capture post content before page renders
- Empty string supplied as input when parsing content
- Query reset problem or flawed code to enable custom post type query
- How can I remove the kses filters when saving a specific post type ? (it breaks my JSON)
- Remove_action does not work
- How to access plugin variables from theme templates without using globals?
- WooCommerce Custom Product Validation [closed]
- Make WP not format code, not insert line breaks in between tags
- add img class to native wordpress galleries
- Get Posts updated or published within the last x hours
- the_content filter together with require_once returns 1 instead of the content of the included file
- Missing Argument 2 for apply_filter
- How to get a single hook from wp_head()?
- WP filter to alter admin CSS styles?
- preview_post_link for Custom Post Types
- How to apply a filter to an ACF wysiwig editor field output?
- Why this filter hook is not working when passing parameters?
- Is it possible to bind a function to a filter hook via Ajax?
- Change the template when the user is not logged in using page_template filter (it does not work)
- Regarding post text filtering
- Add Filter not working with get_posts
- How to Prevent WordPress to encode html in post?
- Filter posts by meta data using custom query
- Remove tags without a specific meta key from “choose from the most used tags”
- Which Filter Do I Use To Modify The Subject Of The Retrieve Password Notification Email?
- Register users by e-mail
- automatic title through filter
- Filter causing loss of _wp_attachment_metadata
- Action hook to control access to certain parts of my site
- Buddypress Filter Multiple Activities [closed]
- How can I tranlslate post date in italian?
- Use alternative front page if cookie is set
- Having wp-admin on different domain
- Use a functions in functions.php to remove a string for template theme
- Add filter return false not working
- create a shortcode with acf including a filter
- Query Posts | Combining multiple form inputs into query arguments to generate one filter result
- How to take shortcode and content separately from a page?
- Custom permalink for attachment
- Overriding Generated Attachment Post URL
- Pagination while keeping the filters
- Apply a filter str_replace on specific caracters array in the_content()
- get_the_archive_title hook unwanted changes!
- using filters on the function from class
- Put data in my-account/view-order/id/ page
- The title of an attachment is not working
- add_filter not adding the filter
- Hide H1 Title using the_title filter
- get_the_excerpt on mobile still displays continue reading
- Filter image and text from post format
- Filter posts by multiple checkbox categories
- Remove pipe in views admin page filter
- Limit total tags in the_content