[wp-trac] [WordPress Trac] #2481: Cannot display hierarchical categories list of all blog's categories (including children)

WordPress Trac wp-trac at lists.automattic.com
Sat Feb 18 23:19:21 GMT 2006


#2481: Cannot display hierarchical categories list of all blog's categories
(including children)
-----------------------+----------------------------------------------------
       Id:  2481       |      Status:  new                     
Component:  Template   |    Modified:  Sat Feb 18 23:19:21 2006
 Severity:  minor      |   Milestone:                          
 Priority:  normal     |     Version:  2.0.1                   
    Owner:  anonymous  |    Reporter:  kwa1975                 
-----------------------+----------------------------------------------------
 When trying to display a hierarchical categories list including children,
 one could write the following PHP line in his/her theme:

 wp_list_cats('hierarchical=1&children=1&child_of=0');

 Since the parent category of all the other categories is 0, we had to set
 child_of to zero.

 However, it appears the wp_list_cats() function uses the value 0 of
 child_of as both an integer value to limit the categories display to a
 given parent category (here, we want to limit it to category 0) AND as a
 boolean value, meaning 0 means "false" and the children of category 0
 won't be displayed.

 To fix this issue, another parameter should be added or a different value
 for child_of should be used.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/2481>
WordPress Trac <http://wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list