I have the following code and need it to exclude the child pages of a page ID;
<?php
$args = array(
'post_type' => 'page',
'post_status' => 'publish',
'numberposts' => -1,
'exclude' => '3984,1939,6006,28,2784',
'depth' => 1
);
$postslist = get_posts($args);
foreach ($postslist as $post) :
setup_postdata($post);
?>
<li>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<?php if ( has_post_thumbnail() ) { the_post_thumbnail('portrait');} else { echo '<img src="#" alt="Something Went Wrong?" title="Sorry - Something went wrong?" />';}?>
</a>
<span><?php meta('issue-number'); ?></span>
</li>
<?php endforeach; ?>
The 'Depth' does not seem to have any effect...
Thanks!
'exclude' => array(3984,1939,6006,28,2784),
might work. Would need to check this though.exclude_tree
param that will solve your problem