query_posts question (3 posts)

  1. rubien
    Posted 5 years ago #

    Hey, so this is kinda advanced.. I added a query post function so the posts show up by custom field date instead of the actual publish date. And I want all the old posts to be hidden so I added a todaysdate line the whole thing looks like this:

    query_posts('showposts=20&category_name=events&meta_key=date&meta_compare=>&meta_value=' . $todaysDate . '&orderby=meta_value&order=ASC');

    now on a subpage I want to do the listening a bit different but I can't figure out how.
    I still want to show all posts that are in the categorie events, my meta key should be now location and I just want to see locations with the meta value "XY" ... but the order of the posts still should be done by meta_key=date and not location. How can I do that? So I have to figure out how I can define 2 different meta_keys in this command.. one for ordering and one for filtering... and then all the events that are older than todaysdate have to be hidden.

  2. Safirul Alredha
    Posted 5 years ago #

    Is this what u looking for? http://scribu.net/wordpress/advanced-metadata-queries.html

    If yes, WP 3.1 Heh.

  3. rubien
    Posted 5 years ago #

    not really. Another thing that I noticed is that all my 2011 $date posts do not show up. any idea?

Topic Closed

This topic has been closed to new replies.

About this Topic