Support » Fixing WordPress » Excluding posts that belong in more than one category

  • Here’s what I am trying to do. Many of my posts are put into several categories and I want to make a few columns in the home page where each column has posts that are in a category AND not in another category.

    query_posts() doesn’t seem to do what I’m looking for because of the Codex page says:

    There is a proviso however: it will exclude all the posts that belong only to category 3.

    So if I have a post that is in both category 1 and 2, and I decide to exclude posts from category 2, the post will still show up since it also belongs to category 2. There has to be a way to get around this proviso.

    How can I make a query that basically says “show all posts that are from category 1 but not in category 2”?

  • The topic ‘Excluding posts that belong in more than one category’ is closed to new replies.