How do I create a list of categories page with the list filtered (3 posts)

  1. hairydogdigital
    Posted 4 years ago #

    I am trying to create a page that is a list of categories that contain posts that are also in another category.

    For example, I have cat1, cat2, cat3, cat4, cat5, catY

    I want to create a page that lists all of the categories (cat1 ... cat5) that have POSTS that are also in catY, without displaying catY in the list.

    I assume it would be easy enough to skip the catY output with a simple if/else test inside of the loop.

    What I am trying to figure out however, is how to set up the loop, as this seems to be beyond the "wp_list_categories" type of setup.

    Any thoughts or suggestions? I would think that someone has already tackled this scenario.

    P.S. I do not want to use a plug-in to do this. I would prefer to create one (or more) custom page templates).


  2. Yojance Rabelo
    Posted 4 years ago #

    I think you are looking for in_category()


  3. hairydogdigital
    Posted 4 years ago #

    That is something like what I did. I had to run a loop querying for catY and then in that loop, I created a array of "uniques" based on other categories (I actually ended up using tags for that bit).

Topic Closed

This topic has been closed to new replies.

About this Topic