category version of list child pages, even on child page? (6 posts)

  1. csleh
    Posted 8 years ago #

    I've got categories and subcategories, and can list the sub-categories on the parent page. But on the child page, I can't show the other children.
    These are categories (posts) not pages, so the solutions for list page don't work.

  2. MichaelH
    Posted 8 years ago #

    Could you provide a link to see the problem?

  3. csleh
    Posted 8 years ago #

    I'm developing a theme on my laptop, so nothing is live yet.

    This quote is from the wp_list_pages codex:

    'This code will show the child pages, and only the child pages, when on a parent or on one of the children.'

    I'm looking to have this apply to categories instead of pages.
    But maybe it's easier to move everything from posts with categories to pages.

  4. MichaelH
    Posted 8 years ago #

    Look at the template tag, wp_list_categories().

    You can use this template tag on a Page template if necessary.

  5. csleh
    Posted 8 years ago #

    Hmmm, wp_list_categories has a tag that lists children, but only children of the current page -- in other words, not siblings.
    So I'll move to Pages to solve most of the problem.

    This is what I'm going for now:
    Page A
    > Page a-1 (shows a-1 and a-2 as subnavigation)
    > Page a-2 (shows a-1 and a-2 as subnavigation)
    (a-2 is assigned to category z)
    list of post titles of category z
    > full post

    - each indent is a level, so click on A and see a-1 and a-2

    - a-1 and a-2 will always display links to each other (they are subnavigation in this A section)

    - Page a-2 displays post titles of category z

    - click on a post title to see the full post

    I'm hoping to have this automated, so if new a-X Pages are added, they automatically appear in the subnavigation. And as new posts are added to a category, they automatically appear on the assigned page. I also want to automate the templates so I don't need a unique template for each category -- new categories should automatically follow along.

  6. Diesel12
    Posted 7 years ago #


    did you ever find a solution for this... I'm trying to do the same thing.... or at least similar...

Topic Closed

This topic has been closed to new replies.

About this Topic