WordPress.org

Ready to get started?Download WordPress

Forums

wp_query help needed - wasted hours already (2 posts)

  1. navigadget
    Member
    Posted 8 years ago #

    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.

  2. navigadget
    Member
    Posted 8 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic