WordPress Boolean Category Display?

David emailed me this afternoon asking about the possibility of listing posts in a WordPress blog that belonged in a given set of categories. So, you could list all posts that belong in both “Category A” and “Category B”. Ironically, Ultimate Tag Warrior offers something like this for combinations of tags, but the native WordPress category interface doesn’t seem to do it. Some way of viewing /category/CategoryA+CategoryB should do the trick.

I’ve been thinking about this all afternoon, and it’s really starting to bug me. There must be a way to do this. Lazyweb, can you help me (and David)?

David emailed me this afternoon asking about the possibility of listing posts in a WordPress blog that belonged in a given set of categories. So, you could list all posts that belong in both “Category A” and “Category B”. Ironically, Ultimate Tag Warrior offers something like this for combinations of tags, but the native WordPress category interface doesn’t seem to do it. Some way of viewing /category/CategoryA+CategoryB should do the trick.

I’ve been thinking about this all afternoon, and it’s really starting to bug me. There must be a way to do this. Lazyweb, can you help me (and David)?

13 thoughts on “WordPress Boolean Category Display?”

  1. Hi D’Arcy-
    Thanks for throwing this up on your site-
    I think you’ve got some pretty bright readers- maybe one of them can point us in the right direction.
    We’ve used the K2 theme on a few sites- including my personal site http://www.esrati.com, and notice that it doesn’t display a list of categories like other themes- since it puts them under the permalink. I haven’t yet figured out if this is good or bad – but for people who don’t seem to get categories are topics- I’m thinking it’s good for now.
    The boolean display (yeah- I couln’t get the right word in my e-mail) seems like it could be really helpful once a site has a couple thousand entries- and the categories have gone mad.
    I’m glad I’m not the only one stumped by this seemingly easy way to search a site.
    Thanks again for posting this- and continuing to make me smarter!

  2. It is honestly one of the things I love so much about Drupal … the ability to create custom search URLs and RSS feeds is critical. Other than that I got nothing for you. Sorry, but we’ll look into it.

  3. Hey Chris-
    Thanks for the direction- that looks promising!
    We’ll give it a shot tomorrow-

    one of the comments on that site said “Thanks so much. I’ve been playing with several other plugins to get this functionality.” so I wonder if there are some others… just in case!

    Gotta love the LazyWeb- and btw- I’ve added Cole and Chris to my RSS reads- interesting stuff guys!
    Thanks

  4. The first thought that comes to my mind is to make a custom page template, then you can use a template tag to do this. The code you would use is the very nifty ‘query_posts’, to which you can add all kinds of strings to pull out the stuff you want from your database. For instance, here’s a string that selects the most recent 5 posts in categories 3 and 4: This little baby is waaay powerful. I’d be happy to send along an example page template, if anyone wants one.

    Another idea (if it’s an option) would be to make the two categories sub-cats, then you could use the simple URL jockey method.

  5. Hi Chris W-
    I’m not smart enough to make a custom page template- and a template tag.
    If you read the description below- and think your custom template solution would work- that would be great- send me an example! The big question- would it refresh with the on the fly categories in WP 2.0?

    Chris L- the intersect plug-in would have been great- except it doesn’t seem to work in 2.0- and I can’t find a working installation of it to see how it’s supposed to work.

    The client I first wanted to do this for is a scooter shop.
    They have lots of scooters come in- for repair- that they may want to talk about- or for sale.
    So- I wanted to have manufacturers categories- but then also be able to cut down- say the Vespa category- to only the ones that are for sale, used, and under 150 cc. or under $1500.

    So- I’m not think the sub cats will work.

  6. hi,

    im trying to implement wordpress as a CMS rather than a blog, here is my site>> <a href="http://lyrics.gotblab.com"></a&gt;

    it contains a huge database that my SQL query usually max-out. is there a way that I can display a category say " only those starting with the letter A, or letter B only…

    Thanks for your attention.

  7. Hmm.. not sure what to do in this situation but if anybody figures it out please post it here so that I can use it too! Thanks!

  8. I came to this page after googling for a solution to this very issue….Chris’s suggestion “query_posts(’cat=3,4&showposts=5′)”…which I’ve been trying… is a “boolean OR” rather than a “boolean AND”….I have to try the intersection plugin.

  9. I’m just getting into using WP and i was hoping to get your feedback into the difference of using WP verse Drupal, any suggestions to using one over the other?

Comments are closed.