wp_list_pages( array|string $args = '' )

Retrieve or display list of pages (or hierarchical post type items) in list (li) format.

25 related functions found for: wp_list_pages

Top ↑

Related terms found for this post

wp-parser-related-wordslist, page, pages, post-template-php, wp-includes, wp-list
wp-parser-packageTemplate, WordPress

Top ↑

Terms Used Terms Used

Terms used in the related posts query

  • list
  • page
  • pages
  • post-template-php
  • Template
  • wp-includes
  • wp-includes/post-template.php
  • wp-list
  • template

Top ↑

Description Description

Top ↑

Parameters Parameters


(array|string) (Optional) Array or string of arguments. Optional.

  • 'child_of'
    (int) Display only the sub-pages of a single page by ID. Default 0 (all pages).
  • 'authors'
    (string) Comma-separated list of author IDs. Default empty (all authors).
  • 'date_format'
    (string) PHP date format to use for the listed pages. Relies on the 'show_date' parameter. Default is the value of 'date_format' option.
  • 'depth'
    (int) Number of levels in the hierarchy of pages to include in the generated list. Accepts -1 (any depth), 0 (all pages), 1 (top-level pages only), and n (pages to the given n depth). Default 0.
  • 'echo'
    (bool) Whether or not to echo the list of pages. Default true.
  • 'exclude'
    (string) Comma-separated list of page IDs to exclude.
  • 'include'
    (array) Comma-separated list of page IDs to include.
  • 'link_after'
    (string) Text or HTML to follow the page link label. Default null.
  • 'link_before'
    (string) Text or HTML to precede the page link label. Default null.
  • 'post_type'
    (string) Post type to query for. Default 'page'.
  • 'post_status'
    (string|array) Comma-separated list or array of post statuses to include. Default 'publish'.
  • 'show_date'
    (string) Whether to display the page publish or modified date for each page. Accepts 'modified' or any other value. An empty value hides the date.
  • 'sort_column'
    (string) Comma-separated list of column names to sort the pages by. Accepts 'post_author', 'post_date', 'post_title', 'post_name', 'post_modified', 'post_modified_gmt', 'menu_order', 'post_parent', 'ID', 'rand', or 'comment_count'. Default 'post_title'.
  • 'title_li'
    (string) List heading. Passing a null or empty value will result in no heading, and the list will not be wrapped with unordered list <ul> tags. Default 'Pages'.
  • 'item_spacing'
    (string) Whether to preserve whitespace within the menu's HTML. Accepts 'preserve' or 'discard'. Default 'preserve'.
  • 'walker'
    (Walker) Walker instance to use for listing pages. Default empty (Walker_Page).

Default value: ''

Top ↑

Return Return

(string|void) HTML list of pages.

Top ↑

Source Source

File: wp-includes/post-template.php


Top ↑

Changelog Changelog

Version Description
4.7.0 Added the item_spacing argument.
1.5.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.