The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Excluding posts that belong in more than one category (1 post)

  1. ccRicers
    Posted 8 years ago #

    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"?

Topic Closed

This topic has been closed to new replies.

About this Topic