Wordpress Query two weeks back

The following query goes back one week but how would I make it so it goes back two:

$columnists=new WP_Query(array('showposts'=>3, 'cat'=>66622, 'orderby'=>'rand','w'=>date('W'),'year'=>date('Y')));

Solutions

Did you try this

'w'=>date('W')-1 

instead of

'w'=>date('W')

If it doasn't work here is the documentation of WP_Query function http://codex.wordpress.org/Class_Reference/WP_Query

Tags: Mysql / Wordpress

Similar questions

Show date of friday every 2 weeks
I have woocommerce products with special pickup dates. Pickup day is on fridays. For example a products has a pickup time in two weeks, the date i want to show by the product should be: What my code below do is: Here i calculate the dates: This is how i use the function above to get the pickup date for each product! Thanks for your inputs...

Also ask

We use cookies to deliver the best possible experience on our website. By continuing to use this site, accepting or closing this box, you consent to our use of cookies. To learn more, visit our privacy policy.