• Resolved bekar09

    (@bekar09)


    Is it possible to query posts based on the current date and then randomise the results using ‘&orderby=rand’.

    First I need to query the posts based on the current date and then apply ‘&orderby=rand’ to it? How do I do it?

Viewing 3 replies - 16 through 18 (of 18 total)
  • You’ll have to look at the time parameters section of query_posts for that.

    Thread Starter bekar09

    (@bekar09)

    You’ll have to look at the time parameters section of query_posts for that.

    I went through it

    w= – week of the year (from 0 to 53) and uses the MySQL WEEK command Mode=1.

    but could’nt make it out. could you please frame the query. please MichealH. thanks.

    If you are to return posts in the last 7 days then you will need the function described in the Return posts for various date ranges: section of the query posts article.

Viewing 3 replies - 16 through 18 (of 18 total)
  • The topic ‘Custom queries’ is closed to new replies.