WordPress.org

Support

Support » How-To and Troubleshooting » wp_query help needed – wasted hours already

wp_query help needed – wasted hours already

  • I should’ve asked earlier before wasting so much time…
    OK, I’m trying to get 10 posts from the events category INCLUDING THE ONES WITH FUTURE DATE. For some reason the below only shows stuff from the past.

    $yf_query = new WP_Query('category_name=events&showposts=10');

    I’m ok w/ dirty hacks such as year=2005||year=2006||year=2007 so I’m good for three years but I don’t know the right syntax for this as well.

    Please help.

Viewing 1 replies (of 1 total)
  • I found my solution myself. Add this line before the code I pasted above.
    query_posts('year=2005,2006,2007,2008,2009,2010');

    I’m good until 2010 🙂
    In case you are wondering I tried doing year > 2005. No good.

Viewing 1 replies (of 1 total)
  • The topic ‘wp_query help needed – wasted hours already’ is closed to new replies.
Skip to toolbar