Title: help with query_posts()
Last modified: August 19, 2016

---

# help with query_posts()

 *  [innovine](https://wordpress.org/support/users/innovine/)
 * (@innovine)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/help-with-query_posts-2/)
 * I am having trouble creating a suitable parameter for query_posts(). Ideally,
   I would like to show only posts created within the last three working days.. 
   any suggestions how to calculate this??! The documentation I’ve seen suggests
   only day=x. Are there any other date related parameters I can use, something 
   like day_of_week or age_of_post ??

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/help-with-query_posts-2/#post-1088012)
 * Assuming that “the last three working days” is the same as the last three days,
   the [query_posts()](http://codex.wordpress.org/Template_Tags/query_posts#Time_Parameters)
   article does have an example of using a function to do what you want. Of course
   the example shows returning posts in the last 30 days so just change that to 
   3 days.
 *  Thread Starter [innovine](https://wordpress.org/support/users/innovine/)
 * (@innovine)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/help-with-query_posts-2/#post-1088071)
 * Hey, thanks for the reply.
    By working days, I mean monday to friday. I want 
   to skip the weekends (this is a blog for tracking work related issues). I’m looking
   at the SQL examples and am wondering if it’s easier to do this in SQL than PHP,
   doesn’t SQL have day of week and day of month type functions for doing maths 
   on dates?
 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/help-with-query_posts-2/#post-1088073)
 * Hmm, guess that means you need some access to a work calendar to deal with holidays.
 * MySQL has a WEEKDAY() argument.
 * Also might look at this plugin:
    [http://www.dagondesign.com/articles/posts-from-last-x-days-plugin-for-wordpress/](http://www.dagondesign.com/articles/posts-from-last-x-days-plugin-for-wordpress/)

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘help with query_posts()’ is closed to new replies.

## Tags

 * [query_posts](https://wordpress.org/support/topic-tag/query_posts/)

 * 3 replies
 * 2 participants
 * Last reply from: [MichaelH](https://wordpress.org/support/users/michaelh/)
 * Last activity: [16 years, 11 months ago](https://wordpress.org/support/topic/help-with-query_posts-2/#post-1088073)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
