WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 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:

Description

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)

comment:1 @filosofo6 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.

comment:2 @Denis-de-Bernardy6 years ago

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