WordPress.org

Forums

Show posts underneath each category in list_categories (3 posts)

  1. mandawahoo
    Member
    Posted 6 years ago #

    I am creating a website that relies heavily on its Category organization. When clicking a category, I am trying to list its subcategories, and then the links underneath that heading for whichever category it is calling out.

    Please see list of categories here:
    http://gibsondesignmanagement.com/reviewcenter/category/designcenters/
    I would like to have a list of all of the posts of each category under each title. I feel that this should be pretty easy, but my brain is hurting from thinking about it, so I figured I'd come ask here. I think I could easily do it manually, but I'd really like for it to update on its own whenever a new category is created (instead of having to go in and add the new category in the code and then call out the posts underneath that).

    If anyone has any advice it will be greatly appreciated. I've already spent so much time going back and forth with this!

    Thank you,
    Amanda

  2. esmi
    Forum Moderator
    Posted 6 years ago #

    Off the top of my head, I'd probably use get_categories with the child_of parameter to grab all the child categories. Then loop through this list and perhaps use get_posts to list the individual posts.

    That said, there may be a more elegant way of achieving the same result.

  3. dragonsjaw
    Member
    Posted 5 years ago #

    Did you ever get the code to make this work?
    I am interested in the same idea.
    ~bobbi

Topic Closed

This topic has been closed to new replies.

About this Topic