Overview
Use this tool to create custom code for WordPress Date Query with WP_Date_Query class.
Usage
- Fill in the user-friendly form.
- Click the “Update Code” button.
- Copy the code to your project.
- Or save it as a snippet and share with the community.
Query Variable Name The variable used in the code.
Date Relation The MySQL keyword used to join the clauses of the query.
Date Type
Date Parameters
Before/After String
Before/After Array
Nested Date Query
Year
Month
Day
Compare Operator used for comparing the value.
Before Text Textual date/time description.
Before Year
Before Month
Before Day
Date Query Select from your saved Date Query snippets.
Week
Day of Week
Day of Week (iso)
Column Comparing column other than the one in the top-level column.
After Text Textual date/time description.
After Year
After Month
After Day
Hour
Minute
Second
Inclusive Include results from dates specified, or not.
Date Type
Date Parameters
Before/After String
Before/After Array
Nested Date Query
Year
Month
Day
Compare Operator used for comparing the value.
Before Text Textual date/time description.
Before Year
Before Month
Before Day
Date Query Select from your saved Date Query snippets.
Week
Day of Week
Day of Week (iso)
Column Comparing column other than the one in the top-level column.
After Text Textual date/time description.
After Year
After Month
After Day
Hour
Minute
Second
Inclusive Include results from dates specified, or not.
Date Type
Date Parameters
Before/After String
Before/After Array
Nested Date Query
Year
Month
Day
Compare Operator used for comparing the value.
Before Text Textual date/time description.
Before Year
Before Month
Before Day
Date Query Select from your saved Date Query snippets.
Week
Day of Week
Day of Week (iso)
Column Comparing column other than the one in the top-level column.
After Text Textual date/time description.
After Year
After Month
After Day
Hour
Minute
Second
Inclusive Include results from dates specified, or not.
Date Type
Date Parameters
Before/After String
Before/After Array
Nested Date Query
Year
Month
Day
Compare Operator used for comparing the value.
Before Text Textual date/time description.
Before Year
Before Month
Before Day
Date Query Select from your saved Date Query snippets.
Week
Day of Week
Day of Week (iso)
Column Comparing column other than the one in the top-level column.
After Text Textual date/time description.
After Year
After Month
After Day
Hour
Minute
Second
Inclusive Include results from dates specified, or not.
Date Type
Date Parameters
Before/After String
Before/After Array
Nested Date Query
Year
Month
Day
Compare Operator used for comparing the value.
Before Text Textual date/time description.
Before Year
Before Month
Before Day
Date Query Select from your saved Date Query snippets.
Week
Day of Week
Day of Week (iso)
Column Comparing column other than the one in the top-level column.
After Text Textual date/time description.
After Year
After Month
After Day
Hour
Minute
Second
Inclusive Include results from dates specified, or not.