If you don’t want a list of Pages, then why are you calling wp_list_pages()
in your code? that function returns a list of Pages.
You probably need to use get_posts()
instead, and then loop through the results to output whatever $post
content you want to display.
e.g. you could do something like the following:
<?php
global $post;
$child_pages = get_posts( array(
'post_parent' => $post->ID
) );
?>
<ul>
<?php
foreach ( $child_pages as $child ) {
?>
<li>
<h3><?php echo $child->post_title; ?></h3>
<div><?php echo $child->post_content; ?></div>
</li>
<?php
}
?>
</ul>
EDIT
If you need to access $post->ID
from outside the Loop, do something like this inside the Loop:
$current_post_id = $post->post_ID;
Then, just use $current_post_id
outside the Loop. (Note that you’ll only want to do this on template pages that display single Posts; otherwise, the value of $current_post_id
will change on every cycle of the foreach
loop.)
You could then change your get_posts()
call accordingly:
$child_pages = get_posts( array(
'post_parent' => $current_post_id
) );