[wp-trac] Re: [WordPress Trac] #5742: add child_of to query_posts
WordPress Trac
wp-trac at lists.automattic.com
Mon May 18 15:44:37 GMT 2009
#5742: add child_of to query_posts
-------------------------+--------------------------------------------------
Reporter: strider72 | Owner: anonymous
Type: enhancement | Status: reopened
Priority: normal | Milestone: 2.9
Component: General | Version:
Severity: normal | Resolution:
Keywords: needs-patch |
-------------------------+--------------------------------------------------
Comment(by filosofo):
Replying to [comment:5 strider72]:
> filosofo -- Either I am misunderstanding you, or you are
misunderstanding this patch.
>
> post_parent works in different circumstances. This patch allows you to
use the following in a template:
>
> query_posts('child_of='.$post->ID);
>
> I use it (for example) for a "section index" page -- I create a loop
that lists just the children of the current page. if I can do this
somehow with "post_parent", could you please give a simple example?
{{{
query_posts(array(
'post_parent' => $post->ID,
'post_status' => 'any',
'post_type' => 'any'
));
}}}
> though it seems a bit unintuitive to use "parent" as "this is the parent
of...." (But if that's the standard in WP, so be it.)
I agree. I wish whoever had come up with these had used more explicit
names, such as "descendant_of" or "parent_of". But that's what we're
stuck with.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/5742#comment:6>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list