WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#9328 closed defect (bug) (worksforme)

wp_list_pages() don't respect depth (subpage issue)

Reported by: LadyAnna Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.7.1
Component: General Keywords: pages, subpages, wp_list_pages()
Focuses: Cc:

Description

On my blog, I tried making the theme handle the pages as don't show subpages in list (they are listed on the parent page). I used the parameter depth=1, as instructed in the codex, still my subpages are shown.

I tried to use the default wp_list_page() with no parameters, and basically the only visual difference was that the title (Pages) was unformatted, the actual list of pages looked the same. The default use of the tag, according to codex, should be that subpages get indented one step from its parent. This does not happen (not for the default theme either so I'm pretty sure it's not a theme thing).

For some reason it seems that subpages are treated exactly as a mainpage when listing.

Change History (3)

comment:1 LadyAnna5 years ago

  • Version set to 2.7.1

comment:2 in reply to: ↑ description zeronex5 years ago

Replying to LadyAnna:

On my blog, I tried making the theme handle the pages as don't show subpages in list (they are listed on the parent page). I used the parameter depth=1, as instructed in the codex, still my subpages are shown.

I tried to use the default wp_list_page() with no parameters, and basically the only visual difference was that the title (Pages) was unformatted, the actual list of pages looked the same. The default use of the tag, according to codex, should be that subpages get indented one step from its parent. This does not happen (not for the default theme either so I'm pretty sure it's not a theme thing).

For some reason it seems that subpages are treated exactly as a mainpage when listing.

Tested on 2.8 with
print_r(wp_list_pages('depth=1&title_li'));
Only shows top level pages, seems to be working fine

comment:3 mrmist5 years ago

  • Milestone 2.7.2 deleted
  • Resolution set to worksforme
  • Status changed from new to closed

depth=1 worksforme too, on 2.8 and 2.7.1.

Potentially a CSS issue?

I'd suggest taking this one to the forums for troubleshooting.

Note: See TracTickets for help on using tickets.