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'm using this code to list child pages of the current page and similar code to get child pages of all ancestors to use in a sidebar contextual hierarchical nav menu:

$pageset = get_posts('numberposts=0&post_type=page&post_parent='.$wp_query->post->ID);

For some reason, both iterations are ignoring posts with a two-digit post id. Everything else shows up fine.

Am I missing something? Do I have a setting that's incorrect? I'm banging my head here...

share|improve this question
up vote 2 down vote accepted

It might be because you are using numberposts=0 If you want to return all posts then you need to use -1 not 0

share|improve this answer
Sweet deal! I got bad info on a tutorial page, and I couldn't find a good explanation of that paramater on the Codex. Any idea what "0" actually does on that parameter? – jfacemyer Feb 1 '12 at 19:30
Interestingly, there was still some sort of issue preventing this "family" (the parent and siblings) context from showing in a hierarchy, while every other "family" of menu items did (even those adjacent on the same level). All I did was move those three to a different parent and it worked fine, then I moved them back and it worked fine still. Something buggy going on there... – jfacemyer Feb 1 '12 at 19:32

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.