• On my home page I am using
    query_posts('cat=-114,-115,-116,-117,-119&showposts=1');
    to exclude posts from those categories. However I would like to be able to show a post from an excluded category if it is also in a category that is not excluded. I.e. if the post is in both category 2 and 114 I would like it to display on the home page. I had hoped that WordPress would do this by default but that does not seem to be the case.
    In the codex on query_posts there is description of how to use an array with “category__in”, i.e.:
    query_posts(array("category__in' => array(2,6)))
    but I cannot figure out how to combine that with the multiple exclusions above. Is there a way to do this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Loren

    (@nbseminary)

    Hi Shane,
    Thanks for the response. The link you included doesn’t particularly address my dilemma. Using query_posts I am already excluding categories from my home page (cat=-3) but am trying to figure out how to “re-include” posts that are in the excluded category. I was trying to do that by adding a non-excluded category to the post but that does not seem to work.
    Maybe it would help to describe how my application of this works. I have multiple authors and one author wants all of his posts to appear in a particular template page (say cat=3 template) and not to appear on the home page – this works fine. But he wants the liberty to allow certain specific posts to appear in both his template as well as on the home page. It is with the re-including of such a post that I am having difficulty.
    Any suggestions?
    Loren

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘displaying excluded posts with query_posts’ is closed to new replies.