[wp-trac] Re: [WordPress Trac] #5742: add child_of to query_posts

WordPress Trac wp-trac at lists.automattic.com
Mon May 18 14:45:30 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  |  
-------------------------+--------------------------------------------------
Changes (by strider72):

  * keywords:  has-patch => needs-patch
  * status:  closed => reopened
  * resolution:  invalid =>
  * milestone:  => 2.9


Comment:

 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?

 This won't be going to 2.8 anyway (feature freeze), so I'll update the
 patch for 2.9 after 2.8 is released.

 If appropriate, I can change the parameter from "child_of" to "parent",
 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.)

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/5742#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list