List categories under condition (4 posts)

  1. nickrita
    Posted 6 years ago #

    I have a page with following categories:

    a) Stories (cat ID 1)
    b) Poems (cat ID 2)
    c) Topic: (cat ID 3)
    ca) Cats (cat ID 4, child of 3)
    cb) Dogs (cat ID 5, child of 3)
    cc) Birds (cat ID 6, child of 3)

    Every story is part of category "story" and one of the topic-categories. Every poem belongs to category "piture" and one of the topic-categories.

    On the stories-archive I want to show a list of the categories
    ca), cb), cc), that only contain the stories, but not the poems.

    It should look like this:
    "All stories about

    Selecting "cats", there should only be shown an archive with only the stories (not the poems) and the topic cats.

    Is there any chance to manage this?


  2. MichaelH
    Posted 6 years ago #

    If you are trying to create a "list of categories" where those categories listed can only have posts that belong to other specific categories, then that might prove hard to accomplish.

    But, if you want to list posts that only belong to a certain set of categories, then using the template tag, query_posts(), with the category__and argument makes that objective relatively easy.

  3. nickrita
    Posted 6 years ago #

    Yes, I want a "list of categories" with posts that belong to another category, but if this isn't possible I try it with category_and.


  4. orchiles
    Posted 5 years ago #

    Learning a lot from the support forum, thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic