On a parent page I want to display all the childpages (first child only) including its template.
For Example
Pages:
Parentpage (Templatename: parentpage)
- Child A (Templatename: childpage)
- Child B (Templatename: childpage)
-- SecondChild B (Templatename: secondchildpage)
- Child C (Templatename: childpage)
In the Template parentpage I have this:
<?php
getchilds = array(
'parent' => $post->ID,
'child_of' => $post->ID,
'sort_column' => 'menu_order',
'sort_order' => 'ASC'
);
$postliset = get_pages($getchilds);
foreach ($postliste as $post) {
echo $post->post_content;
}
?>
This displays the content of all the childpages on the parentpage. So far so good, but I want it to include the templatepart of the childpages as well. So if my childpage template would say:
<div class="childpagestest">
[...]
<?php the_content(); ?>
[...]
</div>
The parentpage should include this code.
I searched the whole function codes of WP for something like the_template but nothing.
Any ideas?
Thank you very much in advance.