WordPress.org

Ready to get started?Download WordPress

Forums

Getting my walker class to output term posts using wp_list_categories(); (3 posts)

  1. jimmyt1988
    Member
    Posted 2 years ago #

    Hi all,

    I have written this code and I am confused at the outcome:

    http://pastebin.com/kwjM3BX7

    When run, it outputs:

    Product categories
      Chairs
        Metal
          Metal chair
        Wooden
          Wooden chair
        Wooden chair
      Tables
        Wooden
          Wooden table
        Wooden table

    It is suppose to output the product_category taxonomy terms:

    "Chairs" with its children:
    "Metal" and "Wooden"

    and

    "Tables" with its children:
    "Wooden"

    Then for each sub term, it should output the posts that belong to it:

    Wooden chair
    Metal chair
    Wooden table

    But instead it cycles through the posts:

    "Wooden chair" for example

    and then ends the ul and then does Wooden chair as if it's a term when infact its just a post.

    Any ideas?

    [ Please be patient and do not bump. That's not permitted here. ]

  2. jimmyt1988
    Member
    Posted 2 years ago #

    EDIT::::::::::

    On further inspection. It is not a data issue at all. If I order by DESC on the initial list, it outputs the Metal as a double up.

    EDIT::::::::::

    If I make hierarchical false on the first list function, the parent terms disappear but there are no duplicate entries..

  3. jimmyt1988
    Member
    Posted 2 years ago #

    I'm still stuck on this. Any ideas?

Topic Closed

This topic has been closed to new replies.

About this Topic