WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:

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

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?

share|improve this question
<ul id="my_cutom_type-list">
    <?php wp_list_pages( 'post_type=my_custom_type&title_li=' ); ?>
share|improve this answer
Haha. Wow, I feel stupid. Thanks. I somehow had it in my head that list_pages wouldn't work because they were "post" types and didn't even bother to try it. Thank you!. – Appledore Jun 18 '11 at 3:07

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.