Displaying Child pages of the current page in post format is not working
-
Hi there!
I′m trying to call this function on my page, since i want to show the sub-pages in post format, but it doesn′t seem to be working, it does nothing. Since I got this code from the Codex, I′m sure that the code is ok and I′m doing something wrong. The question is, should I call something else besides adding this to my page?<?php $mypages = get_pages( array( 'child_of' => $post->ID, 'sort_column' => 'post_date', 'sort_order' => 'desc' ) ); foreach( $mypages as $page ) { $content = $page->post_content; if ( ! $content ) // Check for empty page continue; $content = apply_filters( 'the_content', $content ); ?> <h2><a href="<?php echo get_page_link( $page->ID ); ?>"><?php echo $page->post_title; ?></a></h2> <div class="entry"><?php echo $content; ?></div> <?php } ?>
Thanks a lot!!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Displaying Child pages of the current page in post format is not working’ is closed to new replies.