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...


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

  • 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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