Last active
August 29, 2015 14:15
-
-
Save schalkburger/1e827aa086af704fa9ea to your computer and use it in GitHub Desktop.
Wordpress list page children content
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 | |
$args = array( | |
'post_type' => 'page', | |
'numberposts' => 99, | |
'post_status' => 'publish', | |
'order' => 'ASC', | |
'post_parent' => 1, // Any post parent | |
); | |
$attachments = get_posts($args); | |
if ($attachments) { | |
foreach ($attachments as $post) { ?> | |
<div class="child-page-item clearfix" id="post-<?php the_ID(); ?>"> | |
<?php if ( (function_exists('has_post_thumbnail')) && (has_post_thumbnail())) : ?> | |
<a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_post_thumbnail(''); ?></a> | |
<?php else :?><?php endif;?> | |
<h3><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h3> | |
</div> | |
<?php | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment