WordPress.org

Ready to get started?Download WordPress

Forums

List post from Custom Post type with hierarchy? (2 posts)

  1. oloranya
    Member
    Posted 2 years ago #

    I have a custom post type that is set to have hierarchy. I'm trying to create a list of posts in that post type that display's that hierarchy using nested unordered lists. I have this post structure:

    Post
    -child post
    -- child of child post
    -- child of child post

    And I want to be able to create a list of posts (which i guess are behaving more like pages since they have hierarchy), that reflects this structure using unordered lists, like so:

    <ul>
           <li>Post
              <ul>
               <li>child post
                   <ul>
                   <li>child of child post</li>
                   <li>chld of child post</li>
                   </ul>
               </li>
             </ul>
           </li>
        </ul>

    What's the best way to do this (if there is one) so that I don't have to go back into the code whenever I add new parent pages?

  2. Stimpyjoy
    Member
    Posted 2 years ago #

    I'm trying to do the same thing. Any luck?

Topic Closed

This topic has been closed to new replies.

About this Topic