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'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
add comment

1 Answer

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
add comment

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.