Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#10279 closed defect (bug) (invalid)

wp_list_pages hierarchical=0 shows hierarchy

Reported by: michaelh Owned by:
Milestone: Priority: low
Severity: minor Version: 2.8
Component: Template Keywords:
Focuses: Cc:


Using the hierarchical=0 with wp_list_pages still causes the hierarchy to display.

Both these produce same result:

wp_list_pages('hierarchical=0&title_li=<h2>Pages</h2>' );
wp_list_pages('hierarchical=1&title_li=<h2>Pages</h2>' );

Seems to be broken as least far back as 2.5.1, if not before.

Note that hierarchical=0 works with wp_list_categories.

Reported in Codex by Dnusim

Change History (2)

#1 @filosofo
11 years ago

  • Resolution set to invalid
  • Status changed from new to closed

wp_list_pages always sets hierarchical to "0" when it calls get_pages, because hierarchical wouldn't work with the "Walker" class.

I think you want to use the "depth" argument instead.

#2 @Denis-de-Bernardy
11 years ago

  • Milestone Unassigned deleted
Note: See TracTickets for help on using tickets.