Created
November 17, 2011 21:55
-
-
Save carlynorama/1374671 to your computer and use it in GitHub Desktop.
Wordpress: Show Child Pages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Show Child Pages | |
* Works, no formating | |
* Must come after <?php the_post(); ?> | |
*/ | |
$myID = $post->ID; | |
$highlighted_args = array( | |
'post_parent' => $myID, | |
'post_type' => 'page', | |
'post_status' => 'publish', | |
'posts_per_page' => 3, | |
'no_found_rows' => true, | |
); | |
// The Featured Posts query. | |
$higlighted = new WP_Query( $highlighted_args ); | |
if ( $higlighted->have_posts() ) : | |
?> | |
<div class="higlighted-posts"> | |
<!--<h1 class="showcase-heading"><?php _e( 'Child Pages', 'twentyeleven' ); ?></h1> --> | |
<?php | |
// Let's roll. | |
while ( $higlighted->have_posts() ) : | |
$higlighted->the_post(); | |
?> | |
<?php the_content(); ?> | |
<?php endwhile; ?> | |
</div><!-- .highlighted-posts --> | |
<?php endif; // if ( $higlighted->have_posts() ) ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment