[wp-testers] More about Categories

Boris Anthony lists.permutype at gmail.com
Sat Sep 23 16:04:59 GMT 2006


Hi gang,
This is somewhat tricky, and not sure where to start, but here goes.

Boolean operators is category post queries. (see I'm not even sure if  
I am using the right words! hah)

Naturally, query_posts allows for cat=1,2,3 , and does it as an  
"OR" ("return all posts categorized as any of these cats). In most  
cases (simple weblogs) this is enough.

To add something to the logics mix here, query_post allows logical  
"AND"s between context filters, e.g.: (cats) AND (author)
(cat1 OR cat2 OR cat3) AND (author9)
This too is enough for 99% of users. ;)

However! haha!
In my particular case, I use the category system (thank goodness for  
hierarchies) to create separate category contexts:
Countries, Topics, Languages (as well as using it to flag "entry  
content types" such as "this is a podcast entry, this is a blog  
entry, this is a "short post", but let's not even go there ... these  
are all requirements of the site in question).

Here's the punchline:
I will very soon start needing to be able to say:
please give me any posts from countryA or countryB but only of  
topicsZ or topicY
e.g.
please give me posts categorized (countryA OR countryB) AND (topicZ  
OR topicY)
e.g.:
query_posts(cat=(A,B)|(z,y)
(or some such)
it gets terribly more complexe...
"same request, but only the blog entries"


So here are my questions:
- well first of all, is this possible already and I just haven't been  
able to find doc for it?
- if not, has this capability (boolean operands for cat selection in  
query_posts) ever been considered?
- if not, would it be hard to do / a conceivably reasonable feature  
request for core?
- if not, is it plugin-able?
- if so... (or even if not, I may be open to considering a hack) any  
one game? I've got a few bucks...

The site in question, if you are curious, is
http://globalvoicesonline.org/

Thank you for your attention. :)

B.


More information about the wp-testers mailing list