I have created a page that loads content from it's subpages.
The subpages contain post_thubnails
.
I use a foreach
-loop to get the content of all pages.
I just can't get the images loaded.
<?php $args = array(
'sort_order' => 'asc',
'sort_column' => 'menu_order',
'child_of' => $post->ID,
'post_type' => 'page',
'post_status' => 'publish'
);
$pages = get_pages($args);
foreach ($pages as $page){
$file = get_post_meta ( $page->ID, '_wp_attached_file', true );
echo $file;
echo '
<div class="full_width_parallax">
<div class="wrap_1280">';
echo $page->post_content;
echo '</div>
</div>';
}
?>
Aside from the example code I have also tried the_post_thumbnail();
but no luck.
Any ideas?
apply_filters( 'the_content', $page->post_content );
which will add paragraph tags and such to your post content where necessary.