With the date_query in wordpress I was trying to get posts for the last working week (Monday to Friday)
I was using:
$base_array = array(
'posts_per_page' => -1,
'fields' => 'ids',
'post_type' => 'cpt',
'post_status' => array('publish'),
'date_query' => array(
'before' => 'next Saturday',
'after' => 'last Monday'
)
);
$base = get_posts($base_array);
But today, a Thursday, returns these values:
From 31/10/2016 to 28/10/2016
Which makes sense with the 'last' days but is there any way that I can get the last Monday to last Friday? Regardless on the day the WP_Query is queried.