WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am currently using the following function to list the children of a page, however the function recursively finds children of the children and I only want to list the direct children of $post->post_parent.

wp_list_pages(array('child_of' => $post->post_parent,'exclude' => $post->ID))

Does anyone know how to do this?

share|improve this question
up vote 0 down vote accepted

Try this:

wp_list_pages(array('child_of' => $post->post_parent,'exclude' => $post->ID, 'depth' => 1))

Read the codex for more details.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.