Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End WordPress Custom Fields from Sub-Page to Parent Page Re: WordPress Custom Fields from Sub-Page to Parent Page

#57929

If you only need a flat list of posts under the current page then simply using query_posts with a loop would be your best option. The only problem is if you have hierarchical pages, which would require nested lists, as that is a little more complicated to acheive and it is this that most of the magic inside wp_list_pages is dedicated to.

I think you could use the following (untested) code as a starting point:

Code:
query_posts(“post_type=page&post_status=publish&post_parent=$post->ID&orderby=title&order=asc&showposts=-1”);
if (have_posts()) : while(have_posts()) : the_post();

echo ‘

  • ‘ . ‘ID) . ‘” title=”‘ . attribute_escape(apply_filters(‘the_title’, $post->post_title)) . ‘”>’ . ‘
  • ‘;

    endwhile; endif;