I’m working on this site for a client and I am trying to modify the current SQL query based on the clients requests. Currently it looks for the first three posts with the custom field ‘homepage’ value of ‘yes’ sorted by date descending.
query_posts('showposts=3&meta_key=homepage&meta_value=yes&cat=-6&cat=-10&cat=-16&orderby=date&order=DESC');
What is requested now is, there is three post excerpt containers that need to be filled each with one post. Container one with post with value one, container two, value two and container three value three.
So I need to search by three different custom fields and find the one result for each field. Can anyone provide any insight? I’d like to still use the query_posts function if possible.
Thanks in advance.
I’ve done the most brute force method and called a query for each meta value.