Okay, so this problem has been bothering me for a while, basically I need to write a VERY complex query for wordpress.
Here’s an example of what I’m trying to do.
Post 1 has a title “My mac computer is shiny”
Post 2 has a title “My windows computer is really slow”
Post 3 has a title “My linux computer is shiny”
Now, I’m writing a keyword filter. I have the following keywords that can be toggled:
Now, basically when you check the box it’ll look through the title of the posts and pull posts containing the keywords. This all works perfect, but I need to find a way to do multiples… okay, no problem right? Just use ‘relation’ => ‘OR’ for the meta_query.
WRONG. Because I also have options above for combining the keyword filter with a category filter. So if I use ‘relation’ => ‘OR’ It’ll display if it has EITHER the category or the keyword. I need it to display ONLY if it’s in the selected category and contains the keywords.
Any way to do this?
- The topic ‘Problems with query_posts()’ is closed to new replies.