Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.