[wp-hackers] boolean logic with tag and categorie url params?
burobjorn at gmail.com
Tue Jun 21 20:23:24 UTC 2011
I've been (re)evaluating WordPress' ability to query post using _only_
the tag and category parameters for a project of mine. It's been a while
using this (roughly 3 years according to ticket #5433) and I wondered
what the current state would be.
Thus far my conclusion is that it's a lot better then it used to be,
however there seems no support to be for a combination of boolean AND
with an boolean OR unless using a combination of categories and tags is
used. So I cannot force the query to do something like: 'give me all
posts with tag1 and tag2 and either tag3 or tag4'. Is this correct?
Here are some examples of the urls I tested (trying to write a coherent
blog post on this..)
Shows only posts with both tags
Shows all posts tagged with one or more of these tags tag1, tag2, or
tag3. It does NOT show the posts with at least tag1 and then either tag2
or tag3 (or both).
Shows only posts in Category2 tagged with both tag1 and tag2
Shows posts in one or both categories as long as the post has been
tagged with both tags
Ps: Is there more documentation on the url parameters in relation to
querying? I tried the Codex, but I might have missed something?
More information about the wp-hackers