OR statement in queries (custom fields OR categories)
-
I have a query where I select posts with 4 specific meta values:
query_posts("&paged=".$page."meta_key=mf_page_type&meta_compare=in&meta_value=news, gig, interview, article&showposts=8&orderby=ASC");
but I need to add an OR statement to get what I like to see, because I have one category (ID: 21) that over rules those meta values.
The where in SQL should look like:
... and ( (meta_key = 'mf_page_type' and meta_value in ('news', 'gig', 'interview', 'article')) or (cat=21) ) ...
How can I do this?
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘OR statement in queries (custom fields OR categories)’ is closed to new replies.