Last active
December 16, 2015 15:18
-
-
Save jrthib/5454506 to your computer and use it in GitHub Desktop.
Wordpress example that retrieves child pages and outputs them
This file contains hidden or 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 | |
query_posts( | |
array( | |
'showposts' => 20, | |
'post_parent' => $page_id, | |
'post_type' => 'page', | |
'order' => 'ASC' | |
) | |
); | |
$i = 0; | |
while (have_posts()) : the_post(); ?> | |
<?php $slug = basename(get_permalink()); ?> | |
<div id="<?php echo $slug; ?>" class="pane"> | |
<div class="content"> | |
<div class="inner"> | |
<h2 class="title"><?php the_title(); ?></h2> | |
<?php the_content(); ?> | |
</div> | |
</div> | |
</div> | |
<?php $i++; ?> | |
<?php endwhile; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment