Get Posts Between Certain Dates WordPress REST API
Paulund is full of premium tutorials and support to help with your development
Sign up to get full access to all tutorials.
When building your WordPress theme using the REST API one of the pages you might want to correct is the Post archives page that displays all the posts for a certain month. Using the WP_Query object you will do this by passing in a date_query parameter with a after and before argument. Using the REST API you can perform the same search by using the after and before querystring parameters that will limit response to posts published before a given ISO8601 compliant date. Using the DateTime object you can . . .