Home › Forums › Back End › WordPress Custom Fields from Sub-Page to Parent Page › Re: WordPress Custom Fields from Sub-Page to Parent Page
May 21, 2009 at 7:39 pm
#57929
davesgonebananas
Member
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();‘ . ‘ID) . ‘” title=”‘ . attribute_escape(apply_filters(‘the_title’, $post->post_title)) . ‘”>’ . ‘
if (have_posts()) : while(have_posts()) : the_post();
echo ‘
‘;
endwhile; endif;