Date_query, particular case
-
Hi, i’m trying to make a query that call all posts published after 2 months ago. Looking WP codex I realized something like this:
$args = array( 'post_type' => 'post', 'date_query' => array( array( 'column' => 'post_date_gmt', 'after' => '2 month ago', ) ) );
I can’t test it. For you will it work? My only “?” is in the after => ‘2 month ago’. Or should it be ‘2 months ago’?
In Codex was only wrote “See WP_Date_Query::build_mysql_datetime()’, “but found anything…
- The topic ‘Date_query, particular case’ is closed to new replies.