• 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)
  • Assuming that “the last three working days” is the same as the last three days, the query_posts() 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

    (@innovine)

    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?

    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/

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

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