I am creating a menu for a documentation site very much like this: http://getbootstrap.com/components/
I am using a hierarchical custom post type (manual). I am currently using wp_list_pages() to output the list. This gives me the nested structure that I am looking for:
<ul>
<li>Parent Post</li>
<ul>
<li>Child Post</li>
<li>Child Post</li>
</ul>
<li>Parent Post</li>
<ul>
<li>Child Post</li>
<li>Child Post</li>
</ul>
</ul>
<!-- and so on -->
Unfortunately, wp_list_pages() outputs the permalink to the post like this:
<li class="page_item page-item-332"><a href="http://myurl.com/manual/introduction-to-the-manual/organization/">1.1 – Manual Organization</a></li>
and I need it to output the post_id like this:
<li class="page_item page-item-332"><a href="#332">1.1 – Manual Organization</a></li>
Also, here is my wp_list_pages code:
<ul id="markdown-toc">
<li><h3><a href="#contents">Contents</a></h3></li>
<ul id="my_cutom_type-list">
<?php wp_list_pages( 'post_type=manual&title_li=' ); ?>
</ul>
</ul>