in WordPress

Get Posts Between Certain Dates WordPress REST API

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.

$args = array( 'date_query' => array( array( 'after' => 'January 1st, 2017', 'befo

Upgrade to access all content on Paulund

Members unlock all tutorials and snippets

Access to all downloadable content

Access to code examples before others

Sign Up Now

Already a member? Login here

Subscribe To The Weekly Newsletter

Get weekly updates to your email